LogLevel extends LogLevel

Log levels according to RFC 3164

Table of Contents

Properties

$levels  : array<string|int, mixed>
Reverse look up of log level to level name.

Methods

atLeast()  : array<string|int, string>
Returns a list of all log levels at least as severe as the specified level.
getInternalName()  : string
Resolves the name of the log level and returns its internal string representation
getName()  : string
Resolves the name of a log level and returns it in upper case letters
isValidLevel()  : bool
Checks a level for validity, whether it is an integer and in the range of 0-7.
normalizeLevel()  : int
Normalizes level by converting it from string to integer
validateLevel()  : void
Validates a log level.

Properties

$levels

Reverse look up of log level to level name.

protected static array<string|int, mixed> $levels = [self::EMERGENCY, self::ALERT, self::CRITICAL, self::ERROR, self::WARNING, self::NOTICE, self::INFO, self::DEBUG]

Methods

atLeast()

Returns a list of all log levels at least as severe as the specified level.

public static atLeast(int|string $level) : array<string|int, string>
Parameters
$level : int|string
Return values
array<string|int, string>

getInternalName()

Resolves the name of the log level and returns its internal string representation

public static getInternalName(int $level) : string
Parameters
$level : int
Return values
string

getName()

Resolves the name of a log level and returns it in upper case letters

public static getName(int $level) : string
Parameters
$level : int

Log level.

Return values
string —

Log level name.

isValidLevel()

Checks a level for validity, whether it is an integer and in the range of 0-7.

public static isValidLevel(int $level) : bool
Parameters
$level : int

log level to validate

Return values
bool —

TRUE if the given log level is valid, FALSE otherwise

normalizeLevel()

Normalizes level by converting it from string to integer

public static normalizeLevel(string|int $level) : int
Parameters
$level : string|int
Return values
int

validateLevel()

Validates a log level.

public static validateLevel(int $level) : void
Parameters
$level : int

log level to validate

Tags
throws
InvalidArgumentException

if the given log level is invalid

On this page

Search results