Skip to content

Commit

Permalink
added methods to deal with messageQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Fenton committed Oct 12, 2010
1 parent 88102fe commit 46736cf
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/KLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,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
*
Expand Down

0 comments on commit 46736cf

Please sign in to comment.