openthread-br
0.3.0-72c0388
|
Go to the documentation of this file.
33 #ifndef OTBR_COMMON_LOGGING_HPP_
34 #define OTBR_COMMON_LOGGING_HPP_
42 #error "OTBR_LOG_TAG is not defined"
45 #include "common/types.hpp"
131 void otbrDump(
otbrLogLevel aLevel,
const char *aLogTag,
const char *aPrefix,
const void *aMemory,
size_t aSize);
160 #define otbrLogResult(aError, aFormat, ...) \
163 otbrError _err = (aError); \
164 otbrLog(_err == OTBR_ERROR_NONE ? OTBR_LOG_INFO : OTBR_LOG_WARNING, OTBR_LOG_TAG, aFormat ": %s", \
165 ##__VA_ARGS__, otbrErrorString(_err)); \
239 #define otbrLogEmerg(...) otbrLog(OTBR_LOG_EMERG, OTBR_LOG_TAG, __VA_ARGS__)
240 #define otbrLogAlert(...) otbrLog(OTBR_LOG_ALERT, OTBR_LOG_TAG, __VA_ARGS__)
241 #define otbrLogCrit(...) otbrLog(OTBR_LOG_CRIT, OTBR_LOG_TAG, __VA_ARGS__)
242 #define otbrLogErr(...) otbrLog(OTBR_LOG_ERR, OTBR_LOG_TAG, __VA_ARGS__)
243 #define otbrLogWarning(...) otbrLog(OTBR_LOG_WARNING, OTBR_LOG_TAG, __VA_ARGS__)
244 #define otbrLogNotice(...) otbrLog(OTBR_LOG_NOTICE, OTBR_LOG_TAG, __VA_ARGS__)
245 #define otbrLogInfo(...) otbrLog(OTBR_LOG_INFO, OTBR_LOG_TAG, __VA_ARGS__)
246 #define otbrLogDebug(...) otbrLog(OTBR_LOG_DEBUG, OTBR_LOG_TAG, __VA_ARGS__)
248 #endif // OTBR_COMMON_LOGGING_HPP_
@ OTBR_LOG_CRIT
Critical conditions.
Definition: logging.hpp:55
void otbrLogInit(const char *aIdent, otbrLogLevel aLevel, bool aPrintStderr)
Definition: logging.cpp:73
@ OTBR_LOG_INFO
Informational.
Definition: logging.hpp:59
void otbrLogvNoFilter(otbrLogLevel aLevel, const char *aFormat, va_list aArgList)
Definition: logging.cpp:137
void otbrLogDeinit(void)
Definition: logging.cpp:254
otbrLogLevel otbrLogGetLevel(void)
Definition: logging.cpp:58
void otbrLogSetLevel(otbrLogLevel aLevel)
Definition: logging.cpp:66
void otbrDump(otbrLogLevel aLevel, const char *aLogTag, const char *aPrefix, const void *aMemory, size_t aSize)
Definition: logging.cpp:143
void otbrLogEnableSyslog(bool aEnabled)
void otbrLogv(otbrLogLevel aLevel, const char *aFormat, va_list aArgList)
Definition: logging.cpp:127
otbrLogLevel
Definition: logging.hpp:51
@ OTBR_LOG_NOTICE
Normal but significant condition.
Definition: logging.hpp:58
@ OTBR_LOG_WARNING
Warning conditions.
Definition: logging.hpp:57
otbrError
Definition: types.hpp:70
const char * otbrErrorString(otbrError aError)
Definition: logging.cpp:193
@ OTBR_LOG_ERR
Error conditions.
Definition: logging.hpp:56
void otbrLog(otbrLogLevel aLevel, const char *aLogTag, const char *aFormat,...)
Definition: logging.cpp:108
@ OTBR_LOG_EMERG
System is unusable.
Definition: logging.hpp:53
@ OTBR_LOG_DEBUG
Debug level messages.
Definition: logging.hpp:60
@ OTBR_LOG_ALERT
Action must be taken immediately.
Definition: logging.hpp:54