public function getLogs()
    {
        $logsArray = [];

        $logs = LoggerORM::findAll();

        foreach ($logs as $log) {

            $isException = false;

            $log = (array) $log;

            $logCabin = [];

            if ($log['exception'] !== null && is_array($log['exception']) && count($log['exception']) > 0) {

                $isException = true;

                foreach ($log['exception'] as $key => $value) {

                    $key = $this->deathByCamels($key);

                    $logCabin[$key] = $value;
                }

                if (($options = $this->getOptions($log['log_hash'])) !== null) {

                    $logCabin['options'] = $options->details;

                } else {

                    $logCabin['options'] = [
                        'keep_dates' => $this->module->config('log_dates'),
                        'keep_messages' => $this->module->config('log_messages')
                    ];
                }
            }

            $logCabin['message'] = $log['messages'];

            $logCabin['dates'] = array_map(function($date) {

                if ($date === null) {

                    return null;
                }
                $date = new \DateTime($date);

                return date_format($date, 'Y/m/d H:i:s');

            }, $log['dates']);

            $logCabin['count'] = $log['count'];

            $logCabin['errorLevel'] = $log['error_level'];

            $logCabin['loggerName'] = $log['logger_name'];

            $logCabin['id'] = $log['id'];

            $logCabin['logHash'] = $log['log_hash'];

            $logsArray[] = $isException ? ['exception' => $logCabin] : ['message' => $logCabin];
        }

        return $logsArray;
    }
public function getLogs()
    {
        $logsArray = [];

        $logs = LoggerORM::findAll();

        foreach ($logs as $log) {

            $isException = false;

            $log = (array) $log;

            $logCabin = [];

            if ($log['exception'] !== null && is_array($log['exception']) && count($log['exception']) > 0) {

                $isException = true;

                foreach ($log['exception'] as $key => $value) {

                    $key = $this->deathByCamels($key);

                    $logCabin[$key] = $value;
                }

                if (($options = $this->getOptions($log['log_hash'])) !== null) {

                    $logCabin['options'] = $options->details;

                } else {

                    $logCabin['options'] = [
                        'keep_dates' => $this->module->config('log_dates'),
                        'keep_messages' => $this->module->config('log_messages')
                    ];
                }
            }

            $logCabin['message'] = $log['messages'];

            $logCabin['dates'] = array_map(function($date) {

                if ($date === null) {

                    return null;
                }
                $date = new \DateTime($date);

                return date_format($date, 'Y/m/d H:i:s');

            }, $log['dates']);

            $logCabin['count'] = $log['count'];

            $logCabin['errorLevel'] = $log['error_level'];

            $logCabin['loggerName'] = $log['logger_name'];

            $logCabin['id'] = $log['id'];

            $logCabin['logHash'] = $log['log_hash'];

            $logsArray[] = $isException ? ['exception' => $logCabin] : ['message' => $logCabin];
        }

        return $logsArray;
    }
public function getLogs ( ) { $ logsArray = [ ] ; $ logs = LoggerORM :: findAll ( ) ; foreach ( $ logs as $ log ) { $ isException = false ; $ log = ( array ) $ log ; $ logCabin = [ ] ; if ( $ log [ 'exception' ] !== null && is_array ( $ log [ 'exception' ] ) && count ( $ log [ 'exception' ] ) > 0 ) { $ isException = true ; foreach ( $ log [ 'exception' ] as $ key => $ value ) { $ key = $ this -> deathByCamels ( $ key ) ; $ logCabin [ $ key ] = $ value ; } if ( ( $ options = $ this -> getOptions ( $ log [ 'log_hash' ] ) ) !== null ) { $ logCabin [ 'options' ] = $ options -> details ; } else { $ logCabin [ 'options' ] = [ 'keep_dates' => $ this -> module -> config ( 'log_dates' ) , 'keep_messages' => $ this -> module -> config ( 'log_messages' ) ] ; } } $ logCabin [ 'message' ] = $ log [ 'messages' ] ; $ logCabin [ 'dates' ] = array_map ( function ( $ date ) { if ( $ date === null ) { return null ; } $ date = new \ DateTime ( $ date ) ; return date_format ( $ date , 'Y/m/d H:i:s' ) ; } , $ log [ 'dates' ] ) ; $ logCabin [ 'count' ] = $ log [ 'count' ] ; $ logCabin [ 'errorLevel' ] = $ log [ 'error_level' ] ; $ logCabin [ 'loggerName' ] = $ log [ 'logger_name' ] ; $ logCabin [ 'id' ] = $ log [ 'id' ] ; $ logCabin [ 'logHash' ] = $ log [ 'log_hash' ] ; $ logsArray [ ] = $ isException ? [ 'exception' => $ logCabin ] : [ 'message' => $ logCabin ] ; } return $ logsArray ; }
Abraham Lincoln lived in a log cabin
@return array
Abraham Lincoln lived in a log cabin