diff --git a/logger.php b/logger.php index 321b4d0..489cb33 100644 --- a/logger.php +++ b/logger.php @@ -55,10 +55,11 @@ class logger /** Store a new message log in the log manager defined by $logtype The message can be multiple types. An array will be stored in textual form - but it will accept only one depth. + but it will accept only one depth. + The $message is not fixed, you can pass the number of parameters you want @param integer|null $priority Priority to use @param mixed ...$message Message to log */ - public function log ($priority=LOG_NOTICE, ...$message) + public function log ($priority=LOG_NOTICE, $message) { if ($this->loglevelmin < $priority) return; @@ -71,8 +72,12 @@ class logger $msg .= "[".$_SERVER["REMOTE_ADDR"]."] "; } + // The messages are all the parameters of the function except the first, + // which is the priority + $messages = func_get_args (); + array_shift ($messages); // Convert each part of message to text - foreach ($message as $m) + foreach ($messages as $m) { if (is_array ($m)) {