Documentation

Level
in package

FinalYes

Log level class

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
5.0.0

Table of Contents

Constants

SEVERITY  = [\Psr\Log\LogLevel::EMERGENCY => 0, \Psr\Log\LogLevel::ALERT => 1, \Psr\Log\LogLevel::CRITICAL => 2, \Psr\Log\LogLevel::ERROR => 3, \Psr\Log\LogLevel::WARNING => 4, \Psr\Log\LogLevel::NOTICE => 5, \Psr\Log\LogLevel::INFO => 6, \Psr\Log\LogLevel::DEBUG => 7]
Severity map: PSR-3 level string => RFC severity int

Methods

fromSeverity()  : string
Convert a severity int (0-7) into its canonical PSR-3 level string
toName()  : string
Convert a PSR-3 level string into its uppercase display name
toSeverity()  : int
Convert a PSR-3 level string or a legacy severity int into a severity int (0-7)

Constants

SEVERITY

Severity map: PSR-3 level string => RFC severity int

private array<string|int, mixed> SEVERITY = [\Psr\Log\LogLevel::EMERGENCY => 0, \Psr\Log\LogLevel::ALERT => 1, \Psr\Log\LogLevel::CRITICAL => 2, \Psr\Log\LogLevel::ERROR => 3, \Psr\Log\LogLevel::WARNING => 4, \Psr\Log\LogLevel::NOTICE => 5, \Psr\Log\LogLevel::INFO => 6, \Psr\Log\LogLevel::DEBUG => 7]

Methods

fromSeverity()

Convert a severity int (0-7) into its canonical PSR-3 level string

public static fromSeverity(int $severity) : string
Parameters
$severity : int
Tags
throws
InvalidArgumentException
Return values
string

toName()

Convert a PSR-3 level string into its uppercase display name

public static toName(string $level) : string
Parameters
$level : string
Tags
throws
InvalidArgumentException
Return values
string

toSeverity()

Convert a PSR-3 level string or a legacy severity int into a severity int (0-7)

public static toSeverity(mixed $level) : int
Parameters
$level : mixed
Tags
throws
InvalidArgumentException
Return values
int

        
On this page

Search results