Skip to content
Browse files

add error() and change level defaults

  • Loading branch information...
1 parent 5e75bec commit 8f108e27186cb3e1e229c89943a088cf8b25e223 @giveit-deploy giveit-deploy committed Nov 19, 2012
Showing with 40 additions and 12 deletions.
  1. +40 −12 Plugin/Plugin.php
View
52 Plugin/Plugin.php
@@ -22,10 +22,11 @@ class Plugin
public $labels = array(
0 => 'init',
1 => 'fatal',
- 2 => 'warning',
- 3 => 'info',
- 4 => 'debug',
- 5 => 'trace',
+ 2 => 'error',
+ 3 => 'warning',
+ 4 => 'info',
+ 5 => 'debug',
+ 6 => 'trace',
);
/**
@@ -122,45 +123,65 @@ public function log($level, $message)
/**
* Fatal defaults to level 1
+ *
+ * @param string $message
*/
public function fatal($message)
{
return $this->parent()->log(1, $message);
}
/**
- * Warning defaults to level 2
+ * Error defaults to level 2
+ *
+ * @param string $message
*/
- public function warning($message)
+ public function error($message)
{
return $this->parent()->log(2, $message);
}
/**
- * Info defaults to level 3
+ * Warning defaults to level 3
+ *
+ * @param string $message
*/
- public function info($message)
+ public function warning($message)
{
return $this->parent()->log(3, $message);
}
/**
- * Debug defaults to level 4
+ * Info defaults to level 4
+ *
+ * @param string $message
*/
- public function debug($message)
+ public function info($message)
{
return $this->parent()->log(4, $message);
}
/**
- * Trace defaults to level 5
+ * Debug defaults to level 5
+ *
+ * @param string $message
*/
- public function trace($message)
+ public function debug($message)
{
return $this->parent()->log(5, $message);
}
/**
+ * Trace defaults to level 6
+ *
+ * @param string $message
+ */
+ public function trace($message)
+ {
+ return $this->parent()->log(6, $message);
+ }
+
+ /**
* Output or buffer text depending on the logging mode
*/
protected function output($text)
@@ -185,6 +206,8 @@ protected function buffer($text)
}
/**
+ * Get the contents of the buffer
+ *
* @return string contents of the buffer
*/
protected function getBuffer()
@@ -210,6 +233,11 @@ public function getDate()
return date($this->dateFormat);
}
+ /**
+ * Get the time elapsed since the last message was logged
+ *
+ * @return string time in the format specified by the elapsedTimeFormat property
+ */
public function getElapsedTime()
{
$now = microtime(true);

0 comments on commit 8f108e2

Please sign in to comment.
Something went wrong with that request. Please try again.