public static function createLogs($logFiles = array(), $logDir = null) { $config = Erdiko::getConfig(); if (empty($logFiles)) { $logFiles = $config["logs"]["files"][0]; } if ($logDir == null) { $logDir = $config["logs"]["path"]; } Erdiko::$_logObject = new Logger($logFiles, $logDir); }
/** * log * * @usage Erdiko::log('Sample notice',Logger::LogLevel,'Default') * Need to import erdiko\core\Logger to use this function * @todo add log level as a number instead of a constant * @return bool $sucess */ public static function log($level, $message, array $context = array()) { if (Erdiko::$_logObject == null) { $config = Erdiko::getConfig("application/default"); $logFiles = $config["logs"]["files"][0]; $logDir = $config["logs"]["path"]; Erdiko::$_logObject = new erdiko\core\Logger($logFiles, $logDir); } return Erdiko::$_logObject->log($level, $message, $context); }