zephyr/subsys/net/lib/openthread/platform/logging.c
Ulf Magnusson 984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00

57 lines
1.1 KiB
C

/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel.h>
#include <stdarg.h>
#include <stdio.h>
#include <openthread/platform/logging.h>
#define LOG_MODULE_NAME net_openthread
#define LOG_LEVEL LOG_LEVEL_DBG
#include <logging/log.h>
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#include "platform-zephyr.h"
#define LOG_PARSE_BUFFER_SIZE 128
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion,
const char *aFormat, ...)
{
ARG_UNUSED(aLogRegion);
char logString[LOG_PARSE_BUFFER_SIZE + 1];
u16_t length = 0U;
/* Parse user string. */
va_list paramList;
va_start(paramList, aFormat);
length += vsnprintf(&logString[length],
(LOG_PARSE_BUFFER_SIZE - length),
aFormat, paramList);
va_end(paramList);
switch (aLogLevel) {
case OT_LOG_LEVEL_CRIT:
LOG_ERR("%s", logString);
break;
case OT_LOG_LEVEL_WARN:
LOG_WRN("%s", logString);
break;
case OT_LOG_LEVEL_INFO:
LOG_INF("%s", logString);
break;
case OT_LOG_LEVEL_DEBG:
LOG_DBG("%s", logString);
break;
default:
break;
}
}