mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 03:44:01 +00:00
ospfd: addition of OSPF_LOG.
Description: Addition of OSPF_LOG for conditionally logging ospf messages, at different log levels. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
This commit is contained in:
parent
3d4e02e230
commit
701f4f616a
15
lib/log.h
15
lib/log.h
@ -129,6 +129,21 @@ extern int proto_redistnum(int afi, const char *s);
|
|||||||
|
|
||||||
extern const char *zserv_command_string(unsigned int command);
|
extern const char *zserv_command_string(unsigned int command);
|
||||||
|
|
||||||
|
#define OSPF_LOG(level, cond, fmt, ...) \
|
||||||
|
do { \
|
||||||
|
if (cond) \
|
||||||
|
zlog_##level(fmt, ##__VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define OSPF_LOG_ERR(fmt, ...) OSPF_LOG(err, true, fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
#define OSPF_LOG_WARN(fmt, ...) OSPF_LOG(warn, true, fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
#define OSPF_LOG_INFO(fmt, ...) OSPF_LOG(info, true, fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
#define OSPF_LOG_DEBUG(cond, fmt, ...) OSPF_LOG(debug, cond, fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
#define OSPF_LOG_NOTICE(fmt, ...) OSPF_LOG(notice, true, fmt, ##__VA_ARGS__)
|
||||||
|
|
||||||
/* structure useful for avoiding repeated rendering of the same timestamp */
|
/* structure useful for avoiding repeated rendering of the same timestamp */
|
||||||
struct timestamp_control {
|
struct timestamp_control {
|
||||||
|
Loading…
Reference in New Issue
Block a user