bug fixing minor improvements
This commit is contained in:
@@ -11,30 +11,22 @@ namespace controller;
|
||||
|
||||
class LogController extends Controller {
|
||||
|
||||
/**
|
||||
* log types. The Value represents the log file name
|
||||
* @var array
|
||||
*/
|
||||
protected static $logTypes = [
|
||||
'debug' => 'debug'
|
||||
];
|
||||
|
||||
/**
|
||||
* get an singleton instance for a logger instance
|
||||
* @param $loggerType
|
||||
* @param $logFileName
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getLogger($loggerType){
|
||||
public static function getLogger($logFileName){
|
||||
|
||||
$f3 = \Base::instance();
|
||||
|
||||
$hiveKey = 'LOGGER' . $loggerType;
|
||||
$hiveKey = 'LOGGER' . $logFileName;
|
||||
|
||||
// check if log controller already exists
|
||||
if( !$f3->exists($hiveKey) ){
|
||||
// create new logger instance
|
||||
|
||||
$logFile = self::$logTypes[$loggerType] . '.log';
|
||||
$logFile = $logFileName . '.log';
|
||||
|
||||
$f3->set($hiveKey, new \Log($logFile));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user