From 342ceac544bf032368efc0694b2d60de67a8bdf5 Mon Sep 17 00:00:00 2001 From: Jean Paul Galea Date: Fri, 24 Jul 2015 14:01:22 +0200 Subject: [PATCH] Modify log write. - Log::log() internally support array implode, so no need to duplicate functionality. - however, the internal implode uses two consecutive spaces as separator, so this will change the log format slightly. e.g. "delta=x now=y" becomes "delta=x now=y" --- ykval-verify.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ykval-verify.php b/ykval-verify.php index 9fd48e4..14ae192 100644 --- a/ykval-verify.php +++ b/ykval-verify.php @@ -444,7 +444,7 @@ if ($sessionCounter == $seenSessionCounter && $sessionUse > $seenSessionUse) $percent = 1; } - $data = array( + $myLog->log(LOG_INFO, 'Timestamp', array( 'seen' => $seenTs, 'this' => $ts, 'delta' => $tsDiff, @@ -453,11 +453,7 @@ if ($sessionCounter == $seenSessionCounter && $sessionUse > $seenSessionUse) 'now' => sprintf('%s (%s)'. $now, strftime('%Y-%m-%d %H:%M:%S', $now)), 'elapsed' => $elapsed, 'deviation' => sprintf('%s secs or %s%%', $deviation, round(100 * $percent)), - ); - $msg = 'Timestamp'; - foreach ($data as $k => $v) $msg .= " $k=$v"; - $myLog->log(LOG_INFO, $msg); - unset($data, $msg); + )); if ($deviation > TS_ABS_TOLERANCE && $percent > TS_REL_TOLERANCE) {