Go to the source code of this file.
Macros | |
#define | _LE_LOG_MSG(level, formatString, ...) |
#define | LE_DEBUG(formatString, ...) _LE_LOG_MSG(LE_LOG_DEBUG, formatString, ##__VA_ARGS__) |
Debug message. More... | |
#define | LE_INFO(formatString, ...) _LE_LOG_MSG(LE_LOG_INFO, formatString, ##__VA_ARGS__) |
Informational message. Normally expected. More... | |
#define | LE_WARN(formatString, ...) _LE_LOG_MSG(LE_LOG_WARN, formatString, ##__VA_ARGS__) |
Warning. Possibly indicates a problem. Should be addressed. More... | |
#define | LE_ERROR(formatString, ...) _LE_LOG_MSG(LE_LOG_ERR, formatString, ##__VA_ARGS__) |
#define | LE_CRIT(formatString, ...) _LE_LOG_MSG(LE_LOG_CRIT, formatString, ##__VA_ARGS__) |
#define | LE_EMERG(formatString, ...) _LE_LOG_MSG(LE_LOG_EMERG, formatString, ##__VA_ARGS__) |
Emergency. A fatal error has occurred. A process is being terminated. More... | |
#define | LE_DEBUG_IF(condition, formatString, ...) if (condition) { _LE_LOG_MSG(LE_LOG_DEBUG, formatString, ##__VA_ARGS__); } |
#define | LE_INFO_IF(condition, formatString, ...) if (condition) { _LE_LOG_MSG(LE_LOG_INFO, formatString, ##__VA_ARGS__); } |
#define | LE_WARN_IF(condition, formatString, ...) if (condition) { _LE_LOG_MSG(LE_LOG_WARN, formatString, ##__VA_ARGS__); } |
#define | LE_ERROR_IF(condition, formatString, ...) if (condition) { _LE_LOG_MSG(LE_LOG_ERR, formatString, ##__VA_ARGS__); } |
#define | LE_CRIT_IF(condition, formatString, ...) if (condition) { _LE_LOG_MSG(LE_LOG_CRIT, formatString, ##__VA_ARGS__); } |
#define | LE_EMERG_IF(condition, formatString, ...) if (condition) { _LE_LOG_MSG(LE_LOG_EMERG, formatString, ##__VA_ARGS__); } |
#define | LE_FATAL(formatString, ...) { LE_EMERG(formatString, ##__VA_ARGS__); exit(EXIT_FAILURE); } |
#define | LE_FATAL_IF(condition, formatString, ...) if (condition) { LE_FATAL(formatString, ##__VA_ARGS__) } |
#define | LE_ASSERT(condition) if (!(condition)) { LE_FATAL("Assert Failed: '%s'", #condition) } |
#define | LE_RESULT_TXT(v) _le_log_GetResultCodeString(v) |
#define | LE_IS_TRACE_ENABLED(traceRef) (le_log_IsTraceEnabled(traceRef)) |
#define | LE_TRACE(traceRef, string, ...) |
Enumerations | |
enum | le_log_Level_t { LE_LOG_DEBUG, LE_LOG_INFO, LE_LOG_WARN, LE_LOG_ERR, LE_LOG_CRIT, LE_LOG_EMERG } |
Functions | |
const char * | _le_log_GetResultCodeString (le_result_t resultCode) |
Function that does the real work of translating result codes. See LE_RESULT_TXT. More... | |
static le_log_TraceRef_t | le_log_GetTraceRef (const char *keywordPtr) |
static bool | le_log_IsTraceEnabled (const le_log_TraceRef_t traceRef) |
static void | le_log_SetFilterLevel (le_log_Level_t level) |
static le_log_Level_t | le_log_GetFilterLevel (void) |
static void | le_log_EnableTrace (const le_log_TraceRef_t traceRef) |
static void | le_log_DisableTrace (const le_log_TraceRef_t traceRef) |
Legato Logging API include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
#define _LE_LOG_MSG | ( | level, | |
formatString, | |||
... | |||
) |
Internal macro to filter out messages that do not meet the current filtering level.
#define LE_ASSERT | ( | condition | ) | if (!(condition)) { LE_FATAL("Assert Failed: '%s'", #condition) } |
This macro does nothing if the condition is true, otherwise it logs the condition expression as a message at EMERGENCY level and then kills the calling process.
#define LE_CRIT | ( | formatString, | |
... | |||
) | _LE_LOG_MSG(LE_LOG_CRIT, formatString, ##__VA_ARGS__) |
Critical error. Fault that almost certainly has or will result in a system failure.
#define LE_CRIT_IF | ( | condition, | |
formatString, | |||
... | |||
) | if (condition) { _LE_LOG_MSG(LE_LOG_CRIT, formatString, ##__VA_ARGS__); } |
LE_CRIT if condition is met.
#define LE_DEBUG | ( | formatString, | |
... | |||
) | _LE_LOG_MSG(LE_LOG_DEBUG, formatString, ##__VA_ARGS__) |
Debug message.
#define LE_DEBUG_IF | ( | condition, | |
formatString, | |||
... | |||
) | if (condition) { _LE_LOG_MSG(LE_LOG_DEBUG, formatString, ##__VA_ARGS__); } |
LE_DEBUG if condition is met.
#define LE_EMERG | ( | formatString, | |
... | |||
) | _LE_LOG_MSG(LE_LOG_EMERG, formatString, ##__VA_ARGS__) |
Emergency. A fatal error has occurred. A process is being terminated.
#define LE_EMERG_IF | ( | condition, | |
formatString, | |||
... | |||
) | if (condition) { _LE_LOG_MSG(LE_LOG_EMERG, formatString, ##__VA_ARGS__); } |
LE_EMERG if condition is met.
#define LE_ERROR | ( | formatString, | |
... | |||
) | _LE_LOG_MSG(LE_LOG_ERR, formatString, ##__VA_ARGS__) |
Error. Definitely indicates a fault that needs to be addressed. Possibly resulted in a system failure.
#define LE_ERROR_IF | ( | condition, | |
formatString, | |||
... | |||
) | if (condition) { _LE_LOG_MSG(LE_LOG_ERR, formatString, ##__VA_ARGS__); } |
LE_ERROR if condition is met.
#define LE_FATAL | ( | formatString, | |
... | |||
) | { LE_EMERG(formatString, ##__VA_ARGS__); exit(EXIT_FAILURE); } |
Log fatal errors by killing the calling process after logging the message at EMERGENCY level. This macro never returns.
Accepts printf-style arguments, consisting of a format string followed by zero or more parameters to be printed (depending on the contents of the format string).
#define LE_FATAL_IF | ( | condition, | |
formatString, | |||
... | |||
) | if (condition) { LE_FATAL(formatString, ##__VA_ARGS__) } |
This macro does nothing if the condition is false, otherwise it logs the message at EMERGENCY level and then kills the calling process.
Accepts printf-style arguments, consisting of a format string followed by zero or more parameters to be printed (depending on the contents of the format string).
#define LE_INFO | ( | formatString, | |
... | |||
) | _LE_LOG_MSG(LE_LOG_INFO, formatString, ##__VA_ARGS__) |
Informational message. Normally expected.
#define LE_INFO_IF | ( | condition, | |
formatString, | |||
... | |||
) | if (condition) { _LE_LOG_MSG(LE_LOG_INFO, formatString, ##__VA_ARGS__); } |
LE_INFO if condition is met.
#define LE_IS_TRACE_ENABLED | ( | traceRef | ) | (le_log_IsTraceEnabled(traceRef)) |
Queries whether or not a trace keyword is enabled.
#define LE_RESULT_TXT | ( | v | ) | _le_log_GetResultCodeString(v) |
Get a null-terminated, printable string representing an le_result_t value.
For example, LE_RESULT_TXT(LE_NOT_PERMITTED) would return a pointer to a string containing "LE_NOT_PERMITTED".
"(unknown)" will be returned if the value given is out of range.
#define LE_TRACE | ( | traceRef, | |
string, | |||
... | |||
) |
Logs the string if the keyword has been enabled by a runtime tool or configuration setting.
#define LE_WARN | ( | formatString, | |
... | |||
) | _LE_LOG_MSG(LE_LOG_WARN, formatString, ##__VA_ARGS__) |
Warning. Possibly indicates a problem. Should be addressed.
#define LE_WARN_IF | ( | condition, | |
formatString, | |||
... | |||
) | if (condition) { _LE_LOG_MSG(LE_LOG_WARN, formatString, ##__VA_ARGS__); } |
LE_WARN if condition is met.
enum le_log_Level_t |
Local definitions that should not be used directly.
const char* _le_log_GetResultCodeString | ( | le_result_t | resultCode | ) |
Function that does the real work of translating result codes. See LE_RESULT_TXT.
[in] | resultCode | Result code value to be translated. |
|
inlinestatic |
Disables a trace.
[in] | traceRef | Trace reference obtained from le_log_GetTraceRef() |
|
inlinestatic |
Enables a trace.
[in] | traceRef | Trace reference obtained from le_log_GetTraceRef(). |
|
inlinestatic |
Gets the log filter level for the calling component.
|
inlinestatic |
Gets a reference to a trace keyword's settings.
[in] | keywordPtr | Pointer to the keyword string. |
|
inlinestatic |
Determines if a trace is currently enabled.
[in] | traceRef | Trace reference obtained from le_log_GetTraceRef(). |
|
inlinestatic |
Sets the log filter level for the calling component.
[in] | level | Log filter level to apply to the current log session. |