Logger.
More...
|
| setLevel ($level=null) |
| Set the logging level. More...
|
|
| getLevel ($severity=true) |
| Get the current logging level severity. More...
|
|
| isLoggable ($level) |
| Check if a level is loggable under current logging level. More...
|
|
| log ($level, $message, array $context=[]) |
| {} More...
|
|
| emergency ($message, array $context=[]) |
| {} More...
|
|
| alert ($message, array $context=[]) |
| {} More...
|
|
| critical ($message, array $context=[]) |
| {} More...
|
|
| error ($message, array $context=[]) |
| {} More...
|
|
| warning ($message, array $context=[]) |
| {} More...
|
|
| notice ($message, array $context=[]) |
| {} More...
|
|
| info ($message, array $context=[]) |
| {} More...
|
|
| debug ($message, array $context=[]) |
| {} More...
|
|
| dump ($data) |
| Dump data to log. More...
|
|
| disable () |
| Temporarily disable logging and capture logs (before tests) More...
|
|
| enable () |
| Restore logging and get record of log calls (after tests) More...
|
|
|
static | factory (?InputInterface $input=null, ?OutputInterface $output=null) |
| Build a new logger. More...
|
|
|
| normalizeLevel ($level=null) |
| Normalizes legacy string or numeric representation of the level to LogLevel strings. More...
|
|
Logger.
Use elgg()->logger
Definition at line 26 of file Logger.php.
◆ alert()
Elgg\Logger::alert |
( |
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ critical()
Elgg\Logger::critical |
( |
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ debug()
Elgg\Logger::debug |
( |
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ disable()
Temporarily disable logging and capture logs (before tests)
Call disable() before your tests and enable() after. enable() will return a list of calls to log() (and helper methods) that were not acted upon.
- Note
- This behaves like a stack. You must call enable() for each disable() call.
- Returns
- void
- See also
- enable()
Definition at line 336 of file Logger.php.
◆ dump()
Elgg\Logger::dump |
( |
|
$data | ) |
|
Dump data to log.
- Parameters
-
mixed | $data | The data to log |
- Returns
- void
Definition at line 320 of file Logger.php.
◆ emergency()
Elgg\Logger::emergency |
( |
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ enable()
Restore logging and get record of log calls (after tests)
- Returns
- array
- See also
- disable()
Definition at line 347 of file Logger.php.
◆ error()
Elgg\Logger::error |
( |
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ factory()
static Elgg\Logger::factory |
( |
?InputInterface |
$input = null , |
|
|
?OutputInterface |
$output = null |
|
) |
| |
|
static |
Build a new logger.
- Parameters
-
null | InputInterface | $input | Console input |
null | OutputInterface | $output | Console output |
- Returns
- static
Definition at line 78 of file Logger.php.
◆ getLevel()
Elgg\Logger::getLevel |
( |
|
$severity = true | ) |
|
Get the current logging level severity.
- Parameters
-
bool | $severity | If true, will return numeric representation of the logging level |
- Returns
- int|string|false
Definition at line 205 of file Logger.php.
◆ info()
Elgg\Logger::info |
( |
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ isLoggable()
Elgg\Logger::isLoggable |
( |
|
$level | ) |
|
Check if a level is loggable under current logging level.
- Parameters
-
mixed | $level | Level name or severity code |
- Returns
- bool
Definition at line 220 of file Logger.php.
◆ log()
Elgg\Logger::log |
( |
|
$level, |
|
|
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ normalizeLevel()
Elgg\Logger::normalizeLevel |
( |
|
$level = null | ) |
|
|
protected |
Normalizes legacy string or numeric representation of the level to LogLevel strings.
- Parameters
-
- Returns
- string|false
Definition at line 136 of file Logger.php.
◆ notice()
Elgg\Logger::notice |
( |
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ setLevel()
Elgg\Logger::setLevel |
( |
|
$level = null | ) |
|
Set the logging level.
- Parameters
-
- Returns
- void
Definition at line 177 of file Logger.php.
◆ warning()
Elgg\Logger::warning |
( |
|
$message, |
|
|
array |
$context = [] |
|
) |
| |
◆ $disabled_stack
Elgg\Logger::$disabled_stack = [] |
|
protected |
◆ $elgg_levels
Elgg\Logger::$elgg_levels |
|
staticprotected |
Initial value:= [
0 => false,
100 => LogLevel::DEBUG,
200 => LogLevel::INFO,
250 => LogLevel::NOTICE,
300 => LogLevel::WARNING,
400 => LogLevel::ERROR,
500 => LogLevel::CRITICAL,
550 => LogLevel::ALERT,
600 => LogLevel::EMERGENCY,
]
Definition at line 36 of file Logger.php.
◆ $legacy_levels
Elgg\Logger::$legacy_levels |
|
staticprotected |
Initial value:= [
'OFF' => false,
'INFO' => LogLevel::INFO,
'NOTICE' => LogLevel::NOTICE,
'WARNING' => LogLevel::WARNING,
'ERROR' => LogLevel::ERROR,
]
Definition at line 52 of file Logger.php.
◆ $level
◆ CHANNEL
const Elgg\Logger::CHANNEL = 'ELGG' |
◆ OFF
const Elgg\Logger::OFF = 600 |
The documentation for this class was generated from the following file: