function log($level, $message) { static $data = array(); if (\PEAR2\Pyrus\Config::initializing()) { // we can't check verbose until initializing is complete, so save // the message, and only display the log after config is initialized $data[] = array($level, $message); return; } if (count($data)) { $save = $data; $data = array(); foreach ($save as $info) { $this->log($info[0], $info[1]); } } if ($level <= $this->verbose) { if (strlen($message) && $message[strlen($message) - 1] !== "\r") { echo $message . "\n"; } else { echo $message; } } }