2 Commits
1.0.1 ... 1.0.3

Author SHA1 Message Date
289f35cf6b add logs folder 2024-08-09 17:13:37 -04:00
8dff31b4ee bugfix 2024-08-09 02:18:45 -04:00
2 changed files with 5 additions and 1 deletions

View File

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

2
logs/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore