![]() |
sysrepo 2.0.53
YANG-based system repository for all-around configuration management.
|
Functions | |
sr_log_level_t | sr_log_get_stderr (void) |
Learn current standard error output log level. | |
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. | |
void | sr_log_stderr (sr_log_level_t log_level) |
Enables / disables / changes log level (verbosity) of logging to standard error output. | |
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. | |
const char * | sr_strerror (int err_code) |
Returns the error message corresponding to the error code. | |
enum | sr_error_t { SR_ERR_OK = 0 , SR_ERR_INVAL_ARG , SR_ERR_LY , SR_ERR_SYS , SR_ERR_NO_MEMORY , 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... | |
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. | |
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.
[in] | level | Verbosity level of the log entry. |
[in] | message | Message of the log entry. |
Definition at line 75 of file sysrepo_types.h.
enum sr_error_t |
Sysrepo error codes.
Definition at line 38 of file sysrepo_types.h.
enum sr_log_level_t |
Log levels used to determine if message of certain severity should be printed.
Definition at line 61 of file sysrepo_types.h.
sr_log_level_t sr_log_get_stderr | ( | void | ) |
Learn current standard error output log level.
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. |
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). |
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). |
const char * sr_strerror | ( | int | err_code | ) |
Returns the error message corresponding to the error code.
[in] | err_code | Error code. |