private static function _write($type, $message) {
        $log_path = Config::get('log.folder', LOLLIPOP_STORAGE_LOG);
        $log_enable = Config::get('log.enable', true);
        $log_hourly = Config::get('log.hourly', false);
        
        if (!is_dir($log_path))
           throw new \Lollipop\Exception\Runtime('Log folder doesn\'t exists'); 
        
        if (!is_writeable($log_path))
           throw new \Lollipop\Exception\Runtime('Log folder is not writeable'); 

        if (!isset(self::$_messages[$type]))
            throw new \Lollipop\Exception\Argument('Invalid log type');
        
        // Save to memory
        array_push(self::$_messages[$type], $message);
        
        if ($log_enable && !self::$_busy) {
            self::$_busy = true;
            
            // Create filename base on configuration (daily or hourly)
            $filename = $log_path . DIRECTORY_SEPARATOR . ($log_hourly ? date('Y-m-d-H') : date('Y-m-d')) . '.log';
            
            // Save to file
            file_put_contents($filename, date('Y-m-d H:i:s') . ' [' . strtoupper($type) . '] ' . $message . "\n", FILE_APPEND);
            
            self::$_busy = false;
        }
    }
private static function _write($type, $message) {
        $log_path = Config::get('log.folder', LOLLIPOP_STORAGE_LOG);
        $log_enable = Config::get('log.enable', true);
        $log_hourly = Config::get('log.hourly', false);
        
        if (!is_dir($log_path))
           throw new \Lollipop\Exception\Runtime('Log folder doesn\'t exists'); 
        
        if (!is_writeable($log_path))
           throw new \Lollipop\Exception\Runtime('Log folder is not writeable'); 

        if (!isset(self::$_messages[$type]))
            throw new \Lollipop\Exception\Argument('Invalid log type');
        
        // Save to memory
        array_push(self::$_messages[$type], $message);
        
        if ($log_enable && !self::$_busy) {
            self::$_busy = true;
            
            // Create filename base on configuration (daily or hourly)
            $filename = $log_path . DIRECTORY_SEPARATOR . ($log_hourly ? date('Y-m-d-H') : date('Y-m-d')) . '.log';
            
            // Save to file
            file_put_contents($filename, date('Y-m-d H:i:s') . ' [' . strtoupper($type) . '] ' . $message . "\n", FILE_APPEND);
            
            self::$_busy = false;
        }
    }
private static function _write ( $ type , $ message ) { $ log_path = Config :: get ( 'log.folder' , LOLLIPOP_STORAGE_LOG ) ; $ log_enable = Config :: get ( 'log.enable' , true ) ; $ log_hourly = Config :: get ( 'log.hourly' , false ) ; if ( ! is_dir ( $ log_path ) ) throw new \ Lollipop \ Exception \ Runtime ( 'Log folder doesn\'t exists' ) ; if ( ! is_writeable ( $ log_path ) ) throw new \ Lollipop \ Exception \ Runtime ( 'Log folder is not writeable' ) ; if ( ! isset ( self :: $ _messages [ $ type ] ) ) throw new \ Lollipop \ Exception \ Argument ( 'Invalid log type' ) ; // Save to memory array_push ( self :: $ _messages [ $ type ] , $ message ) ; if ( $ log_enable && ! self :: $ _busy ) { self :: $ _busy = true ; // Create filename base on configuration (daily or hourly) $ filename = $ log_path . DIRECTORY_SEPARATOR . ( $ log_hourly ? date ( 'Y-m-d-H' ) : date ( 'Y-m-d' ) ) . '.log' ; // Save to file file_put_contents ( $ filename , date ( 'Y-m-d H:i:s' ) . ' [' . strtoupper ( $ type ) . '] ' . $ message . "\n" , FILE_APPEND ) ; self :: $ _busy = false ; } }
Append to log file

@param   string  $message    Message log

@throws  \Lollipop\Exception\Runtime
@throws  \Lollipop\Exception\Argument

@return  bool
Append to log file