Skip to content

Commit

Permalink
refactor: update log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiuhc committed Jan 9, 2024
1 parent 939c1ec commit ac58d23
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Logger/InternalLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ public function log($level, $message, array $context = array())

private function shouldLog(int $level): bool
{
return $level >= $this->logLevel;
return $level <= $this->logLevel;
}
}
15 changes: 8 additions & 7 deletions src/Logger/LogLevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

class LogLevel
{
public const EMERGENCY = 8;
public const ALERT = 7;
public const CRITICAL = 6;
public const ERROR = 5;
public const OFF = -1;
public const EMERGENCY = 0;
public const ALERT = 1;
public const CRITICAL = 2;
public const ERROR = 3;
public const WARNING = 4;
public const NOTICE = 3;
public const INFO = 2;
public const DEBUG = 1;
public const NOTICE = 5;
public const INFO = 6;
public const DEBUG = 7;

public static function toString(int $level): string
{
Expand Down

0 comments on commit ac58d23

Please sign in to comment.