LogLevels
in package
A list of log levels to be recognized.
Tags
Table of Contents
- $levels : array<string|int, mixed>
- The configured levels.
- __construct() : mixed
- Constructor.
- getByCriticality() : LogLevel
- Get a registered log level by criticality.
- getByLevelName() : LogLevel
- Get a registered log level by name or throw an exception.
- initWithAliasLevels() : self
- Register the canonical log levels and their popular aliases.
- initWithCanonicalLevels() : self
- register() : void
Properties
$levels
The configured levels.
private
array<string|int, mixed>
$levels
= []
Methods
__construct()
Constructor.
public
__construct([array<string|int, LogLevel> $levels = [] ]) : mixed
Parameters
- $levels : array<string|int, LogLevel> = []
-
Setup with these levels. Circumvents any sanity checks of register
Return values
mixed —getByCriticality()
Get a registered log level by criticality.
public
getByCriticality(int $criticality) : LogLevel
First match wins. No match throws exception.
Parameters
- $criticality : int
Tags
Return values
LogLevel —getByLevelName()
Get a registered log level by name or throw an exception.
public
getByLevelName(string $name) : LogLevel
Matching is case insensitive. No Match throws exception;
Parameters
- $name : string
Tags
Return values
LogLevel —initWithAliasLevels()
Register the canonical log levels and their popular aliases.
public
static initWithAliasLevels() : self
Return values
self —initWithCanonicalLevels()
public
static initWithCanonicalLevels() : self
Return values
self —register()
public
register(LogLevel $level) : void
Parameters
- $level : LogLevel