Changed LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros to take log level as optional parameter. LOG_MODULE_DECLARE can now also be used in static inline functions in headers. Added LOG_LEVEL_SET macro which is used when instance logging API is used to indicate maximal log level compiled into the file. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
21 lines
387 B
C
21 lines
387 B
C
/*
|
|
* Copyright (c) 2018 Nordic Semiconductor ASA
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#include <zephyr.h>
|
|
#include <logging/log.h>
|
|
#include "sample_module.h"
|
|
|
|
LOG_MODULE_REGISTER(MODULE_NAME, CONFIG_SAMPLE_MODULE_LOG_LEVEL);
|
|
|
|
const char *sample_module_name_get(void)
|
|
{
|
|
return STRINGIFY(MODULE_NAME);
|
|
}
|
|
|
|
void sample_module_func(void)
|
|
{
|
|
LOG_INF("log in test_module %d", 11);
|
|
}
|