‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Log\LogLevel Class Reference
Inheritance diagram for TYPO3\CMS\Core\Log\LogLevel:

Static Public Member Functions

static string getName (int $level)
 
static getInternalName (int $level)
 
static bool isValidLevel (int $level)
 
static validateLevel (int $level)
 
static normalizeLevel ($level)
 
static array< string > atLeast ($level)
 

Static Protected Attributes

static array $levels
 

Detailed Description

Log levels according to RFC 3164

Definition at line 23 of file LogLevel.php.

Member Function Documentation

◆ atLeast()

static array<string> TYPO3\CMS\Core\Log\LogLevel::atLeast (   $level)
static

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

Parameters
int | string$level
Returns
‪array<string>

Definition at line 108 of file LogLevel.php.

References TYPO3\CMS\Core\Log\LogLevel\normalizeLevel().

Referenced by TYPO3\CMS\Core\Log\Logger\addWriter(), and TYPO3\CMS\Core\Tests\Unit\Log\LogLevelTest\atLeastReturnsCorrectListOfLevels().

◆ getInternalName()

static TYPO3\CMS\Core\Log\LogLevel::getInternalName ( int  $level)
static

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

Definition at line 54 of file LogLevel.php.

References TYPO3\CMS\Core\Log\LogLevel\validateLevel().

Referenced by TYPO3\CMS\Core\Log\Logger\addProcessor(), and TYPO3\CMS\Core\Log\Logger\log().

◆ getName()

static string TYPO3\CMS\Core\Log\LogLevel::getName ( int  $level)
static

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

Parameters
int$levelLog level.
Returns
‪string Log level name.

Definition at line 46 of file LogLevel.php.

Referenced by TYPO3\CMS\Adminpanel\Modules\Debug\Log\getDataToStore(), and TYPO3\CMS\Adminpanel\Modules\Debug\Log\getSettings().

◆ isValidLevel()

static bool TYPO3\CMS\Core\Log\LogLevel::isValidLevel ( int  $level)
static

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

Parameters
int$level‪log level to validate
Returns
‪bool TRUE if the given log level is valid, FALSE otherwise

Definition at line 67 of file LogLevel.php.

Referenced by TYPO3\CMS\Core\Tests\Unit\Log\LogLevelTest\isValidLevelDoesNotValidateInvalidLevels(), and TYPO3\CMS\Core\Tests\Unit\Log\LogLevelTest\isValidLevelValidatesValidLevels().

◆ normalizeLevel()

◆ validateLevel()

static TYPO3\CMS\Core\Log\LogLevel::validateLevel ( int  $level)
static

Member Data Documentation

◆ $levels

array TYPO3\CMS\Core\Log\LogLevel::$levels
staticprotected
Initial value:
= array(
self::EMERGENCY,
self::ALERT,
self::CRITICAL,
self::ERROR,
self::WARNING,
self::NOTICE,
self::INFO,
self::DEBUG,
)

Reverse look up of log level to level name.

Definition at line 29 of file LogLevel.php.