mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 10:52:18 +01:00
Cosmetic changes.
- remove mix of tabs/spaces, use tabs everywhere. - remove mix of double/single quotes, use single quotes everywhere unless $var substitution.
This commit is contained in:
parent
e76c5002f2
commit
de56a03538
@ -29,22 +29,23 @@
|
||||
|
||||
class Log
|
||||
{
|
||||
|
||||
function __construct($name='ykval')
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->fields = array();
|
||||
|
||||
$this->LOG_LEVELS = array(LOG_EMERG=>'LOG_EMERG',
|
||||
$this->LOG_LEVELS = array(
|
||||
LOG_EMERG => 'LOG_EMERG',
|
||||
LOG_ALERT => 'LOG_ALERT',
|
||||
LOG_CRIT => 'LOG_CRIT',
|
||||
LOG_ERR => 'LOG_ERR',
|
||||
LOG_WARNING => 'LOG_WARNING',
|
||||
LOG_NOTICE => 'LOG_NOTICE',
|
||||
LOG_INFO => 'LOG_INFO',
|
||||
LOG_DEBUG=>'LOG_DEBUG');
|
||||
LOG_DEBUG => 'LOG_DEBUG'
|
||||
);
|
||||
|
||||
openlog("ykval", LOG_PID, LOG_LOCAL0);
|
||||
openlog('ykval', LOG_PID, LOG_LOCAL0);
|
||||
}
|
||||
|
||||
function addField($name, $value)
|
||||
@ -52,25 +53,26 @@ class Log
|
||||
$this->fields[$name] = $value;
|
||||
}
|
||||
|
||||
function log($priority, $message, $arr=null){
|
||||
function log($priority, $message, $arr=null)
|
||||
{
|
||||
if (is_array($arr)) {
|
||||
foreach($arr as $key => $value){
|
||||
if (is_array($value)) {
|
||||
$value = implode(":", $value);
|
||||
$value = implode(':', $value);
|
||||
}
|
||||
$message .= " $key=$value ";
|
||||
}
|
||||
}
|
||||
# Add fields
|
||||
$msg_fields = "";
|
||||
|
||||
$msg_fields = '';
|
||||
foreach ($this->fields as $field => $value) {
|
||||
$msg_fields .= "[" . $value . "] ";
|
||||
$msg_fields .= '[' . $value . '] ';
|
||||
}
|
||||
|
||||
syslog($priority,
|
||||
$this->LOG_LEVELS[$priority] . ':' .
|
||||
$this->name . ':' .
|
||||
$msg_fields .
|
||||
$message);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user