Initial checkin v13.0

This commit is contained in:
Thilina Hasantha
2015-10-10 20:18:50 +05:30
parent 5fdd19b2c5
commit eb3439b29d
1396 changed files with 318492 additions and 0 deletions

41
src/utils/LogManager.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
if(!class_exists('LogManager')){
class LogManager{
private static $me;
private $log;
private function __construct(){
}
public static function getInstance(){
if(empty(self::$me)){
self::$me = new LogManager();
self::$me->log = new Logger(APP_NAME);
if(is_writable(ini_get('error_log'))){
self::$me->log->pushHandler(new StreamHandler(ini_get('error_log'), LOG_LEVEL));
}else{
self::$me->log->pushHandler(new StreamHandler(CLIENT_BASE_PATH.'data/app.log', LOG_LEVEL));
}
}
return self::$me;
}
public function info($message){
$this->log->addInfo($message);
}
public function debug($message){
$this->log->addDebug($message);
}
public function error($message){
$this->log->addError($message);
}
}
}