TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
LogLevel Class Reference

Static Public Member Functions

static getName ($level)
 
static isValidLevel ($level)
 
static validateLevel ($level)
 
static normalizeLevel ($level)
 

Public Attributes

const EMERGENCY = 0
 
const ALERT = 1
 
const CRITICAL = 2
 
const ERROR = 3
 
const WARNING = 4
 
const NOTICE = 5
 
const INFO = 6
 
const DEBUG = 7
 

Static Protected Attributes

static $levels
 

Detailed Description

Log levels according to RFC 3164

Definition at line 20 of file LogLevel.php.

Member Function Documentation

static getName (   $level)
static

Resolves the name of a log level.

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

Definition at line 118 of file LogLevel.php.

Referenced by LogRecord\__toString(), PhpErrorLogWriter\writeLog(), and FileWriter\writeLog().

static isValidLevel (   $level)
static

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

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

Definition at line 131 of file LogLevel.php.

Referenced by LogLevelTest\isValidLevelDoesNotValidateInvalidLevels(), and LogLevelTest\isValidLevelValidatesValidLevels().

static normalizeLevel (   $level)
static

Normalizes level by converting it from string to integer

Parameters
string$level
Returns
int|string

Definition at line 156 of file LogLevel.php.

Referenced by LogLevelTest\normalizeLevelConvertsValidLevelFromStringToInteger(), and LogLevelTest\normalizeLevelDoesNotConvertInvalidLevel().

static validateLevel (   $level)
static

Validates a log level.

Parameters
int$levellog level to validate
Returns
void
Exceptions
Psr if the given log level is invalid

Definition at line 143 of file LogLevel.php.

Referenced by Logger\addProcessor(), Logger\addWriter(), LogManager\getConfigurationForLogger(), LogLevelTest\isValidLevelThrowsExceptionOnInvalidLevelIfAskedToDoSo(), LogRecord\setLevel(), and Logger\setMinimumLogLevel().

Member Data Documentation

$levels
staticprotected
Initial value:
= [
self::EMERGENCY => 'EMERGENCY'

Definition at line 101 of file LogLevel.php.

const ALERT = 1

Definition at line 39 of file LogLevel.php.

Referenced by Logger\alert(), and FileWriterTest\logsToFileDataProvider().

const CRITICAL = 2

Definition at line 48 of file LogLevel.php.

Referenced by LogRecordTest\constructorSetsCorrectLogLevel(), and Logger\critical().

const ERROR = 3
const INFO = 6

Definition at line 85 of file LogLevel.php.

Referenced by Logger\info(), and FileWriterTest\logsToFileDataProvider().