From de56a03538ead78652fb0ec0909173a63495aefd Mon Sep 17 00:00:00 2001
From: Jean Paul Galea <jeanpaul@yubico.com>
Date: Wed, 15 Jul 2015 15:25:47 +0200
Subject: [PATCH] Cosmetic changes.

- remove mix of tabs/spaces,
	use tabs everywhere.

- remove mix of double/single quotes,
	use single quotes everywhere unless $var substitution.
---
 ykval-log.php | 78 ++++++++++++++++++++++++++-------------------------
 1 file changed, 40 insertions(+), 38 deletions(-)

diff --git a/ykval-log.php b/ykval-log.php
index 6fb1f5f..63f67c7 100644
--- a/ykval-log.php
+++ b/ykval-log.php
@@ -29,48 +29,50 @@
 
 class Log
 {
+	function __construct($name='ykval')
+	{
+		$this->name = $name;
+		$this->fields = array();
 
-  function __construct($name='ykval')
-  {
-    $this->name=$name;
-    $this->fields=array();
+		$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'
+		);
 
-    $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');
+		openlog('ykval', LOG_PID, LOG_LOCAL0);
+	}
 
-    openlog("ykval", LOG_PID, LOG_LOCAL0);
-  }
+	function addField($name, $value)
+	{
+		$this->fields[$name] = $value;
+	}
 
-  function addField($name, $value)
-  {
-    $this->fields[$name]=$value;
-  }
+	function log($priority, $message, $arr=null)
+	{
+		if (is_array($arr)) {
+			foreach($arr as $key => $value){
+				if (is_array($value)) {
+					$value = implode(':', $value);
+				}
+				$message .= " $key=$value ";
+			}
+		}
 
-  function log($priority, $message, $arr=null){
-    if (is_array($arr)) {
-      foreach($arr as $key=>$value){
-        if (is_array($value)) {
-          $value = implode(":", $value);
-        }
-	$message.=" $key=$value ";
-      }
-    }
-    # Add fields
-    $msg_fields = "";
-    foreach ($this->fields as $field=>$value) {
-      $msg_fields .= "[" . $value . "] ";
-    }
-    syslog($priority,
-	   $this->LOG_LEVELS[$priority] . ':' .
-	   $this->name . ':' .
-	   $msg_fields .
-	   $message);
-  }
+		$msg_fields = '';
+		foreach ($this->fields as $field => $value) {
+			$msg_fields .= '[' . $value . '] ';
+		}
 
+		syslog($priority,
+			$this->LOG_LEVELS[$priority] . ':' .
+			$this->name . ':' .
+			$msg_fields .
+			$message);
+	}
 }