define('DEBUGMODE', true); error_reporting(E_ALL); ini_set('display_errors', '1'); $dlevel = intval(getenv("DEBUG")); if ($dlevel > 10) { $dlevel = 10; } base::logLevel($dlevel); } else { define('DEBUGMODE', false); base::logLevel(0); } if (php_sapi_name() == 'cli') { define('LEPTON_CONSOLE', true); if (base::logLevel() == 0) { base::logLevel(LOG_INFO); } } else { define('LEPTON_CONSOLE', false); } if (getenv("LOGFILE")) { define("LOGFILE", fopen(getenv("LOGFILE"), 'a+')); fprintf(LOGFILE, "\n --- MARK --- \n\n"); } else { define("LOGFILE", null); } define('LOG_DEBUG2', 7); define('LOG_DEBUG1', 6); define('LOG_EXTENDED', 5); define('LOG_VERBOSE', 4); define('LOG_BASIC', 3);
private static function __log($prio, $msg) { if ($prio <= base::logLevel()) { foreach (self::$_loggers as $logger) { $logger->__logMessage($prio, $msg); } } }