2017-05-19 01:02:19 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 Fundacion Inria Chile
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @{
|
|
|
|
* @ingroup net
|
|
|
|
* @file
|
|
|
|
* @brief Implementation of OpenThread logging platform abstraction
|
|
|
|
*
|
|
|
|
* @author Jose Ignacio Alamos <jialamos@uc.cl>
|
2018-06-12 17:40:27 +02:00
|
|
|
* @author Baptiste Clenet <bapclenet@gmail.com>
|
2017-05-19 01:02:19 +02:00
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "openthread/platform/logging.h"
|
|
|
|
|
|
|
|
/* adapted from OpenThread posix example:
|
|
|
|
* See: https://github.com/openthread/openthread/blob/master/examples/platforms/posix/logging.c */
|
2018-08-03 17:57:21 +02:00
|
|
|
__attribute__((__format__ (__printf__, 3, 4)))
|
2017-05-19 01:02:19 +02:00
|
|
|
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
|
|
|
{
|
2018-06-12 17:40:27 +02:00
|
|
|
(void) aLogLevel;
|
|
|
|
(void) aLogRegion;
|
2017-05-19 01:02:19 +02:00
|
|
|
va_list args;
|
|
|
|
va_start(args, aFormat);
|
|
|
|
vfprintf(stderr, aFormat, args);
|
2018-06-12 17:40:27 +02:00
|
|
|
fprintf(stderr, "\n");
|
2017-05-19 01:02:19 +02:00
|
|
|
va_end(args);
|
|
|
|
}
|