util/log_error: keep it clear. add a log_msg (#5498)

add log_msg() and keep log_error() as is.
This commit is contained in:
kulikov-a 2022-01-23 21:50:21 +03:00 committed by GitHub
parent 9225fc3b40
commit 279de63e63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View File

@ -130,7 +130,7 @@ function session_auth()
function auth_log($message, $prio = LOG_ERR)
{
openlog("audit", LOG_ODELAY, LOG_AUTH);
log_error($message, $prio);
log_msg($message, $prio);
closelog();
}

View File

@ -926,14 +926,27 @@ function get_interface_list($only_active = false, $include_dmesg = false)
/****f* util/log_error
* NAME
* log_error - Sends a string to syslog.
* log_error - Sends a string to syslog with LOG_ERR severity.
* INPUTS
* $msg - string containing the syslog message.
* $prio - syslog severity level
* $error - string containing the syslog message.
* RESULT
* null
******/
function log_error($msg, $prio = LOG_ERR)
function log_error($error)
{
log_msg($error, LOG_ERR);
}
/****f* util/log_msg
* NAME
* log_msg - Sends a string to syslog with the required severity level.
* INPUTS
* $msg - string containing the syslog message.
* $prio - syslog severity level.
* RESULT
* null
******/
function log_msg($msg, $prio = LOG_ERR)
{
$page = $_SERVER['SCRIPT_NAME'];
if (empty($page)) {