sysrepo
1.4.168
YANG datastore
|
Typedefs | |
typedef enum sr_error_e | sr_error_t |
Sysrepo error codes. More... | |
typedef void(* | sr_log_cb )(sr_log_level_t level, const char *message) |
Sets callback that will be called when a log entry would be populated. More... | |
Enumerations | |
enum | sr_error_e { SR_ERR_OK = 0, SR_ERR_INVAL_ARG, SR_ERR_LY, SR_ERR_SYS, SR_ERR_NOMEM, SR_ERR_NOT_FOUND, SR_ERR_EXISTS, SR_ERR_INTERNAL, SR_ERR_UNSUPPORTED, SR_ERR_VALIDATION_FAILED, SR_ERR_OPERATION_FAILED, SR_ERR_UNAUTHORIZED, SR_ERR_LOCKED, SR_ERR_TIME_OUT, SR_ERR_CALLBACK_FAILED, SR_ERR_CALLBACK_SHELVE } |
Sysrepo error codes. More... | |
enum | sr_log_level_t { SR_LL_NONE = 0, SR_LL_ERR, SR_LL_WRN, SR_LL_INF, SR_LL_DBG } |
Log levels used to determine if message of certain severity should be printed. More... | |
Functions | |
const char * | sr_strerror (int err_code) |
Returns the error message corresponding to the error code. More... | |
void | sr_log_stderr (sr_log_level_t log_level) |
Enables / disables / changes log level (verbosity) of logging to standard error output. More... | |
sr_log_level_t | sr_log_get_stderr (void) |
Learn current standard error output log level. More... | |
void | sr_log_syslog (const char *app_name, sr_log_level_t log_level) |
Enables / disables / changes log level (verbosity) of logging to system log. More... | |
sr_log_level_t | sr_log_get_syslog (void) |
Learn current system log log level. More... | |
void | sr_log_set_cb (sr_log_cb log_callback) |
Sets callback that will be called when a log entry would be populated. Callback will be called for every message regardless of any log level. More... | |
typedef enum sr_error_e sr_error_t |
Sysrepo error codes.
typedef void(* sr_log_cb)(sr_log_level_t level, const char *message) |
enum sr_error_e |
Sysrepo error codes.
enum sr_log_level_t |
Log levels used to determine if message of certain severity should be printed.
const char* sr_strerror | ( | int | err_code | ) |
Returns the error message corresponding to the error code.
[in] | err_code | Error code. |
void sr_log_stderr | ( | sr_log_level_t | log_level | ) |
Enables / disables / changes log level (verbosity) of logging to standard error output.
By default, logging to stderr is disabled. Setting log level to any value other than SR_LL_NONE enables the logging to stderr. Setting log level back to SR_LL_NONE disables the logging to stderr.
[in] | log_level | Requested log level (verbosity). |
sr_log_level_t sr_log_get_stderr | ( | void | ) |
Learn current standard error output log level.
void sr_log_syslog | ( | const char * | app_name, |
sr_log_level_t | log_level | ||
) |
Enables / disables / changes log level (verbosity) of logging to system log.
By default, logging into syslog is disabled. Setting log level to any value other than SR_LL_NONE enables the logging into syslog. Setting log level back to SR_LL_NONE disables the logging into syslog.
Library messages are logged with LOG_USER facility and plugin (syrepo-plugind) messages are logged with LOG_DAEMON facility.
[in] | app_name | Name of the application. If not set, "sysrepo" will be used. |
[in] | log_level | Requested log level (verbosity). |
sr_log_level_t sr_log_get_syslog | ( | void | ) |
Learn current system log log level.
void sr_log_set_cb | ( | sr_log_cb | log_callback | ) |
Sets callback that will be called when a log entry would be populated. Callback will be called for every message regardless of any log level.
[in] | log_callback | Callback to be called when a log entry would populated. |