mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 10:52:18 +01:00
Refactor.
- build separate string from $extra array, and append it in syslog call.
This commit is contained in:
parent
d6433c81ab
commit
2c5d0a6efa
@ -56,12 +56,14 @@ class Log
|
||||
|
||||
public function log ($priority, $message, $extra = NULL)
|
||||
{
|
||||
$final = '';
|
||||
|
||||
if (is_array($extra)) {
|
||||
foreach($extra as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$value = implode(':', $value);
|
||||
}
|
||||
$message .= " $key=$value ";
|
||||
$final .= " $key=$value ";
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +76,7 @@ class Log
|
||||
$this->log_levels[$priority] . ':' .
|
||||
$this->name . ':' .
|
||||
$fields .
|
||||
$message);
|
||||
$message .
|
||||
$final);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user