Permalink
Browse files

added methods to deal with messageQueue

  • Loading branch information...
1 parent 88102fe commit 46736cf9c8029b87889a8805c29c7988dc878bc9 Brian Fenton committed Oct 12, 2010
Showing with 27 additions and 0 deletions.
  1. +27 −0 src/KLogger.php
View
@@ -179,6 +179,33 @@ public function __destruct()
}
/**
+ * Returns (and removes) the last message from the queue.
+ * @return string
+ */
+ public function getMessage()
+ {
+ return array_pop($this->_messageQueue);
+ }
+
+ /**
+ * Returns the entire message queue (leaving it intact)
+ * @return array
+ */
+ public function getMessages()
+ {
+ return $this->_messageQueue;
+ }
+
+ /**
+ * Empties the message queue
+ * @return void
+ */
+ public function clearMessages()
+ {
+ $this->_messageQueue = array();
+ }
+
+ /**
* Writes a $line to the log with a priority level of INFO
*
* @param string $line Information to log

0 comments on commit 46736cf

Please sign in to comment.