mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 10:08:41 +00:00
lib: Convert to flog_warn in agentx.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
78cb655568
commit
ffd9ac069c
@ -158,7 +158,8 @@ static int agentx_log_callback(int major, int minor, void *serverarg,
|
||||
"snmp[err]: %s", msg ? msg : slm->msg);
|
||||
break;
|
||||
case LOG_WARNING:
|
||||
zlog_warn("snmp[warning]: %s", msg ? msg : slm->msg);
|
||||
flog_warn(LIB_WARN_SNMP,
|
||||
"snmp[warning]: %s", msg ? msg : slm->msg);
|
||||
break;
|
||||
case LOG_NOTICE:
|
||||
zlog_notice("snmp[notice]: %s", msg ? msg : slm->msg);
|
||||
|
@ -21,6 +21,18 @@
|
||||
#include "lib_errors.h"
|
||||
|
||||
/* clang-format off */
|
||||
static struct log_ref ferr_lib_warn[] = {
|
||||
{
|
||||
.code = LIB_WARN_SNMP,
|
||||
.title = "SNMP has discovered a warning",
|
||||
.description = "The SNMP AgentX library has returned a warning that we should report to the end user",
|
||||
.suggestion = "Gather Log data and open an Issue.",
|
||||
},
|
||||
{
|
||||
.code = END_FERR,
|
||||
},
|
||||
};
|
||||
|
||||
static struct log_ref ferr_lib_err[] = {
|
||||
{
|
||||
.code = LIB_ERR_PRIVILEGES,
|
||||
@ -114,5 +126,6 @@ static struct log_ref ferr_lib_err[] = {
|
||||
|
||||
void lib_error_init(void)
|
||||
{
|
||||
log_ref_add(ferr_lib_warn);
|
||||
log_ref_add(ferr_lib_err);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ enum lib_log_refs {
|
||||
LIB_ERR_DEVELOPMENT,
|
||||
LIB_ERR_ZMQ,
|
||||
LIB_ERR_UNAVAILABLE,
|
||||
LIB_WARN_SNMP,
|
||||
};
|
||||
|
||||
extern void lib_error_init(void);
|
||||
|
Loading…
Reference in New Issue
Block a user