log($msg, 'info'); } function logWarn($msg) { global $logInst; $logInst->log($msg, 'warn'); } class Logger { private $data = array(); function log($msg, $type = 'info') { $this->data[$type][] = $msg; } function display() { echo '
'; foreach($this->data as $type => $messages) { if (sizeof($messages) > 0) { echo "

$type

"; } } echo '
'; } }