Commit a606612c by irul

add log level

1 parent 21aa8f4e
...@@ -93,7 +93,7 @@ class Logger ...@@ -93,7 +93,7 @@ class Logger
} else { } else {
$log_string = $string; $log_string = $string;
} }
$this->do_write($log_string, $log_source); $this->do_write($log_string, $log_source, "info");
} }
/* /*
...@@ -120,9 +120,9 @@ class Logger ...@@ -120,9 +120,9 @@ class Logger
* *
* $access public * $access public
* */ * */
public function do_write($log_string, $log_source) public function do_write($log_string, $log_source, $log_level = 'debug')
{ {
$log_string = sprintf("%s %s -- %s", date(DATESTRING_FULL), $log_string, $log_source); $log_string = sprintf("%s [%s] %s -- %s", date(DATESTRING_FULL), str_pad(strtoupper($log_level), 5), $log_string, $log_source);
$log_string = $log_string . PHP_EOL; $log_string = $log_string . PHP_EOL;
if ($this->user_handle) { if ($this->user_handle) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!