mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
logging: support context-specific severity
Allow messages to have severity set to INFO or DEBUG depending on the context in which they are made to allow logging important changes made from chronyc or sourcefile, but not spam the system log if those changes are normally expected (e.g. specified in the config).
This commit is contained in:
4
cmdmon.c
4
cmdmon.c
@@ -1515,6 +1515,8 @@ read_from_cmd_socket(int sock_fd, int event, void *anything)
|
||||
}
|
||||
|
||||
if (allowed) {
|
||||
LOG_SetContext(LOGC_Command);
|
||||
|
||||
switch(rx_command) {
|
||||
case REQ_NULL:
|
||||
/* Do nothing */
|
||||
@@ -1762,6 +1764,8 @@ read_from_cmd_socket(int sock_fd, int event, void *anything)
|
||||
tx_message.status = htons(STT_FAILED);
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_UnsetContext(LOGC_Command);
|
||||
} else {
|
||||
tx_message.status = htons(STT_UNAUTH);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user