![]() |
libyang
2.0.194
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
|
Modules | |
Debug messages groups | |
Logging options | |
Typedefs | |
typedef void(* | ly_log_clb) (LY_LOG_LEVEL level, const char *msg, const char *path) |
Logger callback. More... | |
Enumerations | |
enum | LY_LOG_LEVEL { LY_LLERR = 0 , LY_LLWRN = 1 , LY_LLVRB = 2 , LY_LLDBG = 3 } |
Verbosity levels of the libyang logger. More... | |
Functions | |
LIBYANG_API_DECL ly_log_clb | ly_get_log_clb (void) |
Get logger callback. More... | |
uint32_t | ly_log_dbg_groups (uint32_t dbg_groups) |
Enable specific debugging messages (independent of log level). More... | |
LIBYANG_API_DECL LY_LOG_LEVEL | ly_log_level (LY_LOG_LEVEL level) |
Set logger verbosity level. More... | |
LIBYANG_API_DECL uint32_t | ly_log_options (uint32_t opts) |
Set logger options. Default is LY_LOLOG | LY_LOSTORE_LAST. More... | |
LIBYANG_API_DECL void | ly_set_log_clb (ly_log_clb clb, ly_bool path) |
Set logger callback. More... | |
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().
[in] | level | Log level of the message. |
[in] | msg | Message. |
[in] | path | Optional path of the concerned node. |
enum LY_LOG_LEVEL |
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!). |
LIBYANG_API_DECL ly_log_clb ly_get_log_clb | ( | void | ) |
Get logger callback.
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.
[in] | dbg_groups | Bitfield of enabled debug message groups (see Debug messages groups). |
LIBYANG_API_DECL LY_LOG_LEVEL ly_log_level | ( | LY_LOG_LEVEL | level | ) |
Set logger verbosity level.
To get the current value, the function must be called twice resetting the level by the received value.
[in] | level | 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.
[in] | opts | Bitfield of Logging options. |
LIBYANG_API_DECL void ly_set_log_clb | ( | ly_log_clb | clb, |
ly_bool | path | ||
) |
Set logger callback.
[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. |