src/Helper.php
public static function log($level, $message, array $context = array())
    {
        if(static::$_logObject==null)
        {
            $erdikoContext = getenv('ERDIKO_CONTEXT');
            $config = static::getConfig("application", $erdikoContext);
            $logFiles = $config["logs"]["files"][0];
            $logDir = $config["logs"]["path"];

            static::$_logObject = new \erdiko\core\Logger($logFiles, $logDir);
        }

        if(empty($level))
            $level = \Psr\Log\LogLevel::DEBUG; // Default to debug for convenience

        return static::$_logObject->log($level, $message, $context);
    }
public static function log($level, $message, array $context = array())
    {
        if(static::$_logObject==null)
        {
            $erdikoContext = getenv('ERDIKO_CONTEXT');
            $config = static::getConfig("application", $erdikoContext);
            $logFiles = $config["logs"]["files"][0];
            $logDir = $config["logs"]["path"];

            static::$_logObject = new \erdiko\core\Logger($logFiles, $logDir);
        }

        if(empty($level))
            $level = \Psr\Log\LogLevel::DEBUG; // Default to debug for convenience

        return static::$_logObject->log($level, $message, $context);
    }
public static function log ( $ level , $ message , array $ context = array ( ) ) { if ( static :: $ _logObject == null ) { $ erdikoContext = getenv ( 'ERDIKO_CONTEXT' ) ; $ config = static :: getConfig ( "application" , $ erdikoContext ) ; $ logFiles = $ config [ "logs" ] [ "files" ] [ 0 ] ; $ logDir = $ config [ "logs" ] [ "path" ] ; static :: $ _logObject = new \ erdiko \ core \ Logger ( $ logFiles , $ logDir ) ; } if ( empty ( $ level ) ) $ level = \ Psr \ Log \ LogLevel :: DEBUG ; // Default to debug for convenience return static :: $ _logObject -> log ( $ level , $ message , $ context ) ; }
log message to log file
If you enter null for level it will default to 'debug'

@usage \Erdiko::log('debug',"Message here...", array())

@param string $level
@param string $message
@param array $context
@return bool $success
@todo refactor how logging is used, eventually remove from helper
log message to log file If you enter null for level it will default to debug