lib: add "send log" command to log a message#19030
Conversation
931fcf4 to
b852129
Compare
7fd58bb to
fc5717a
Compare
lib/log_vty.c
Outdated
| LOG_LEVEL_DESC | ||
| "Log message to send\n") | ||
| { | ||
| // const char *s; |
| log record-priority | ||
| log file frr.log | ||
|
|
||
| ip route 11.11.11.11/32 lo No newline at end of file |
There was a problem hiding this comment.
which the static route? Probably not, but it's a artifact of the test tools current workings.
I use load_frr_config() now exclusively which scans frr.conf to determine which daemons to load. It doesn't actually check for static routes to load staticd right now, instead topotest just always loads staticd. But this is a practice I use to make staticd load if I needed it.
fc5717a to
7bea8e5
Compare
lib/log_vty.c
Outdated
|
|
||
| DEFPY(send_log, | ||
| send_log_cmd, | ||
| "send log [severity <emergency|alert|critical|error|warning|notice|info|debug>$levelarg] LINE...", |
There was a problem hiding this comment.
In all commands and documentation we refer to these as "log levels" while "severity" don't show up anywhere.
I suggest making the command:
send log [level LEVEL]...
There was a problem hiding this comment.
I was specifically not using level here. We have mixed "priority" log record-priority and level log stdout LEVEL both of which use home-grown non-std keywords emergencies, alerts, critical, errors, warnings, notifications, informational, or debugging.
I'm trying to move us to the industry standard syslog severity notation. I have another PR which adds log record-severity so that the output to the log is using standard syslog severity tags, which auto-stylizing/coloring pagers as well as most users scripts understand.
Currently we output lower-case homegrown tags like errors: foo and debugging: foo. log record-severity is going to output industry standard tags ERROR: , DEBUG: ...
This change is going along with that.
There was a problem hiding this comment.
The commercial router variant of this takes only an integer value from 0-7 with no keyword
There was a problem hiding this comment.
Actually nm we can make this change later if we want to. I'll just use level and the current home-grown keyword values
7bea8e5 to
4e9d082
Compare
Signed-off-by: Christian Hopps <chopps@labn.net>
Signed-off-by: Christian Hopps <chopps@labn.net>
4e9d082 to
3ca6a23
Compare
Allow sending a log message from vtysh. This can be useful to mark logs as well as test logging configuration.