![]() |
libyang 2.1.148
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
|
Logger manipulation routines and error definitions. More...
#include <stdint.h>
#include "config.h"
Go to the source code of this file.
Data Structures | |
struct | ly_err_item |
Libyang full error structure. More... | |
Macros | |
#define | LY_LDGDEPSETS 0x04 |
#define | LY_LDGDICT 0x01 |
#define | LY_LDGXPATH 0x02 |
#define | LY_LOLOG 0x01 |
#define | LY_LOSTORE 0x02 |
#define | LY_LOSTORE_LAST 0x06 |
Typedefs | |
typedef uint8_t | ly_bool |
Type to indicate boolean value. | |
typedef void(* | ly_log_clb) (LY_LOG_LEVEL level, const char *msg, const char *path) |
Logger callback. | |
Enumerations | |
enum | LY_ERR { LY_SUCCESS = 0 , LY_EMEM , LY_ESYS , LY_EINVAL , LY_EEXIST , LY_ENOTFOUND , LY_EINT , LY_EVALID , LY_EDENIED , LY_EINCOMPLETE , LY_ERECOMPILE , LY_ENOT , LY_EOTHER , LY_EPLUGIN = 128 } |
libyang's error codes returned by the libyang functions. More... | |
enum | LY_LOG_LEVEL { LY_LLERR = 0 , LY_LLWRN = 1 , LY_LLVRB = 2 , LY_LLDBG = 3 } |
Verbosity levels of the libyang logger. More... | |
enum | LY_VECODE { LYVE_SUCCESS = 0 , LYVE_SYNTAX , LYVE_SYNTAX_YANG , LYVE_SYNTAX_YIN , LYVE_REFERENCE , LYVE_XPATH , LYVE_SEMANTICS , LYVE_SYNTAX_XML , LYVE_SYNTAX_JSON , LYVE_DATA , LYVE_OTHER } |
libyang's codes of validation error. Whenever ly_errno is set to LY_EVALID, the ly_vecode is also set to the appropriate LY_VECODE value. More... | |
Functions | |
LIBYANG_API_DECL void | ly_err_clean (struct ly_ctx *ctx, struct ly_err_item *eitem) |
Free error structures from a context. | |
LIBYANG_API_DECL struct ly_err_item * | ly_err_first (const struct ly_ctx *ctx) |
Get the first (thread, context-specific) generated error structure. | |
LIBYANG_API_DECL struct ly_err_item * | ly_err_last (const struct ly_ctx *ctx) |
Get the latest (thread, context-specific) generated error structure. | |
LIBYANG_API_DECL void | ly_err_print (const struct ly_ctx *ctx, struct ly_err_item *eitem) |
Print the error structure as if just generated. | |
LIBYANG_API_DECL const char * | ly_errapptag (const struct ly_ctx *ctx) |
Get the last (thread, context-specific) error-app-tag if there was a specific one defined in the module for the last error. | |
LIBYANG_API_DECL LY_ERR | ly_errcode (const struct ly_ctx *ctx) |
Get the last (thread, context-specific) error code. | |
LIBYANG_API_DECL const char * | ly_errmsg (const struct ly_ctx *ctx) |
Get the last (thread, context-specific) error message. If the coresponding module defined a specific error message, it will be used instead the default one. | |
LIBYANG_API_DECL const char * | ly_errpath (const struct ly_ctx *ctx) |
Get the last (thread, context-specific) path of the element where was an error. | |
LIBYANG_API_DECL ly_log_clb | ly_get_log_clb (void) |
Get logger callback. | |
LIBYANG_API_DECL const char * | ly_last_errmsg (void) |
Get the last (thread-specific) error message. | |
LIBYANG_API_DECL uint32_t | ly_log_dbg_groups (uint32_t dbg_groups) |
Enable specific debugging messages (independent of log level). | |
LIBYANG_API_DECL LY_LOG_LEVEL | ly_log_level (LY_LOG_LEVEL level) |
Set logger verbosity level. | |
LIBYANG_API_DECL uint32_t | ly_log_options (uint32_t opts) |
Set logger options. Default is LY_LOLOG | LY_LOSTORE_LAST. | |
LIBYANG_API_DECL void | ly_set_log_clb (ly_log_clb clb, ly_bool path) |
Set logger callback. | |
LIBYANG_API_DECL const char * | ly_strerrcode (LY_ERR err) |
Get human-readable error message for an error code. | |
LIBYANG_API_DECL const char * | ly_strvecode (LY_VECODE vecode) |
Get human-readable error message for a validation error code. | |
LIBYANG_API_DECL void | ly_temp_log_options (uint32_t *opts) |
Set temporary thread-safe logger options overwriting those set by ly_log_options(). | |
LIBYANG_API_DECL LY_VECODE | ly_vecode (const struct ly_ctx *ctx) |
Get the last (thread, context-specific) validation error code. | |
Logger manipulation routines and error definitions.
Copyright (c) 2015 - 2022 CESNET, z.s.p.o.
This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at
https://opensource.org/licenses/BSD-3-Clause
Definition in file log.h.