diff --git a/Classes/Logger.php b/Classes/Logger.php index f898e05..b5c491a 100644 --- a/Classes/Logger.php +++ b/Classes/Logger.php @@ -17,6 +17,7 @@ class Logger { $this->file = fopen( $this->logFilePath, 'a' ); fwrite( $this->file, '===================------++++++++++------===================' . PHP_EOL ); } + public function setupLogFile() { $this->logDirectory = rtrim( CANARY_DEBUG_DIRECTORY, DIRECTORY_SEPARATOR ); if ( ! is_dir( $this->logDirectory ) ) { @@ -31,12 +32,13 @@ class Logger { chmod( $this->logFilePath, 0777 ); } } + public function __destruct() { fwrite( $this->file, '============================================================' . PHP_EOL ); fclose( $this->file ); } - public function addLog( $type = 'log', $log ) { + public function addLog( $type = 'log', $log = '' ) { switch ( CANARY_DEBUG_TO_FILE_LEVEL ) { case CANARY_DEBUG_LEVEL_ERROR: $acceptableLoggingLevels = [