Publicly visible functions and values of the libyang logger. For more information, see Information Logging.
typedef void(* ly_log_clb)(LY_LOG_LEVEL level, const char *msg, const char *path) |
Logger callback.
!IMPORTANT! If an error has a specific error-app-tag defined in the model, it will NOT be set at the time of calling this callback. It will be set right after, so to retrieve it it must be checked afterwards with ly_errapptag().
- Parameters
-
[in] | level | Log level of the message. |
[in] | msg | Message. |
[in] | path | Optional path of the concerned node. |
Definition at line 191 of file log.h.
Verbosity levels of the libyang logger.
Enumerator |
---|
LY_LLERR |
Print only error messages.
|
LY_LLWRN |
Print error and warning messages, default value.
|
LY_LLVRB |
Besides errors and warnings, print some other verbose messages.
|
LY_LLDBG |
Print all messages including some development debug messages (be careful, without subsequently calling ly_log_dbg_groups() no debug messages will be printed!).
|
Definition at line 88 of file log.h.
LIBYANG_API_DECL ly_log_clb ly_get_log_clb |
( |
void |
| ) |
|
Get logger callback.
- Returns
- Logger callback (can be NULL).
LIBYANG_API_DECL uint32_t ly_log_dbg_groups |
( |
uint32_t |
dbg_groups | ) |
|
Enable specific debugging messages (independent of log level).
To get the current value, the function must be called twice resetting the level by the received value.
- Parameters
-
- Returns
- Previous options bitfield.
Set logger verbosity level.
To get the current value, the function must be called twice resetting the level by the received value.
- Parameters
-
[in] | level | Verbosity level. |
- Returns
- Previous verbosity level.
LIBYANG_API_DECL uint32_t ly_log_options |
( |
uint32_t |
opts | ) |
|
Set logger options. Default is LY_LOLOG | LY_LOSTORE_LAST.
To get the current value, the function must be called twice resetting the level by the received value.
- Parameters
-
- Returns
- Previous logger options.
Set logger callback.
- Parameters
-
[in] | clb | Logging callback. |
[in] | path | flag to resolve and provide path as the third parameter of the callback function. In case of validation and some other errors, it can be useful to get the path to the problematic element. Note, that according to the tree type and the specific situation, the path can slightly differs (keys presence) or it can be NULL, so consider it as an optional parameter. If the flag is 0, libyang will not bother with resolving the path. |
LIBYANG_API_DECL void ly_temp_log_options |
( |
uint32_t * |
opts | ) |
|
Set temporary thread-safe logger options overwriting those set by ly_log_options().
- Parameters
-
[in] | opts | Pointer to the temporary Logging options. If NULL, restores the effect of global logger options. |