TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Log\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

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Log levels according to RFC 3164

Author
Ingo Renner ingo@.nosp@m.typo.nosp@m.3.org

Definition at line 21 of file LogLevel.php.

Member Function Documentation

◆ getName()

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

Resolves the name of a log level.

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

Definition at line 111 of file LogLevel.php.

Referenced by TYPO3\CMS\Core\Log\LogRecord\__toString(), TYPO3\CMS\Core\Log\Writer\PhpErrorLogWriter\writeLog(), and TYPO3\CMS\Core\Log\Writer\FileWriter\writeLog().

◆ isValidLevel()

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

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

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

Definition at line 123 of file LogLevel.php.

◆ normalizeLevel()

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

Normalizes level by converting it from string to integer

Parameters
string$level
Returns
integer|string

Definition at line 146 of file LogLevel.php.

Referenced by TYPO3\CMS\Core\Log\Logger\getProcessors().

◆ validateLevel()

Member Data Documentation

◆ $levels

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

Definition at line 94 of file LogLevel.php.

◆ ALERT

const TYPO3\CMS\Core\Log\LogLevel::ALERT = 1

Definition at line 39 of file LogLevel.php.

Referenced by TYPO3\CMS\Core\Log\Logger\alert().

◆ CRITICAL

const TYPO3\CMS\Core\Log\LogLevel::CRITICAL = 2

◆ DEBUG

◆ EMERGENCY

◆ ERROR

const TYPO3\CMS\Core\Log\LogLevel::ERROR = 3

Definition at line 55 of file LogLevel.php.

Referenced by TYPO3\CMS\Core\Log\Logger\error().

◆ INFO

const TYPO3\CMS\Core\Log\LogLevel::INFO = 6

Definition at line 80 of file LogLevel.php.

Referenced by TYPO3\CMS\Core\Log\Logger\info().

◆ NOTICE

const TYPO3\CMS\Core\Log\LogLevel::NOTICE = 5

Definition at line 72 of file LogLevel.php.

Referenced by TYPO3\CMS\Core\Log\Logger\notice().

◆ WARNING

const TYPO3\CMS\Core\Log\LogLevel::WARNING = 4

Definition at line 64 of file LogLevel.php.

Referenced by TYPO3\CMS\Core\Log\Logger\warning().