Elgg  Version 3.0
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Elgg\Logger Class Reference

Logger. More...

Inheritance diagram for Elgg\Logger:

Public Member Functions

 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...
 
 warn ($message, array $context=[])
 Log message at the WARNING level. 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...
 
 setHooks (PluginHooksService $hooks)
 Reset the hooks service for this instance (testing) More...
 

Static Public Member Functions

static factory (InputInterface $input=null, OutputInterface $output=null)
 Build a new logger. More...
 

Public Attributes

const CHANNEL = 'ELGG'
 
const OFF = false
 

Protected Member Functions

 normalizeLevel ($level=null)
 Normalizes legacy string or numeric representation of the level to LogLevel strings. More...
 

Protected Attributes

 $level
 
 $hooks
 

Static Protected Attributes

static $elgg_levels
 
static $legacy_levels
 

Detailed Description

Logger.

Use elgg()->logger

Definition at line 25 of file Logger.php.

Member Function Documentation

Elgg\Logger::alert (   $message,
array  $context = [] 
)

{}

Definition at line 271 of file Logger.php.

Elgg\Logger::critical (   $message,
array  $context = [] 
)

{}

Definition at line 278 of file Logger.php.

Elgg\Logger::debug (   $message,
array  $context = [] 
)

{}

Definition at line 313 of file Logger.php.

Elgg\Logger::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 353 of file Logger.php.

Elgg\Logger::dump (   $data)

Dump data to log.

Parameters
mixed$dataThe data to log
Returns
bool

Definition at line 337 of file Logger.php.

Elgg\Logger::emergency (   $message,
array  $context = [] 
)

{}

Definition at line 264 of file Logger.php.

Elgg\Logger::enable ( )

Restore logging and get record of log calls (after tests)

Returns
array
See also
disable()

Definition at line 364 of file Logger.php.

Elgg\Logger::error (   $message,
array  $context = [] 
)

{}

Definition at line 285 of file Logger.php.

static Elgg\Logger::factory ( InputInterface  $input = null,
OutputInterface  $output = null 
)
static

Build a new logger.

Parameters
$inputInputInterface Console input
$outputOutputInterface Console output
Returns
static

Definition at line 82 of file Logger.php.

Elgg\Logger::getLevel (   $severity = true)

Get the current logging level severity.

Parameters
bool$severityIf true, will return numeric representation of the logging level
Returns
int|string|false

Definition at line 194 of file Logger.php.

Elgg\Logger::info (   $message,
array  $context = [] 
)

{}

Definition at line 306 of file Logger.php.

Elgg\Logger::isLoggable (   $level)

Check if a level is loggable under current logging level.

Parameters
mixed$levelLevel name or severity code
Returns
bool

Definition at line 209 of file Logger.php.

Elgg\Logger::log (   $level,
  $message,
array  $context = [] 
)

{}

Definition at line 223 of file Logger.php.

Elgg\Logger::normalizeLevel (   $level = null)
protected

Normalizes legacy string or numeric representation of the level to LogLevel strings.

Parameters
mixed$levelLevel
Returns
string|false

Definition at line 140 of file Logger.php.

Elgg\Logger::notice (   $message,
array  $context = [] 
)

{}

Definition at line 299 of file Logger.php.

Elgg\Logger::setHooks ( PluginHooksService  $hooks)

Reset the hooks service for this instance (testing)

Parameters
PluginHooksService$hooksthe plugin hooks service
Returns
void

Definition at line 376 of file Logger.php.

Elgg\Logger::setLevel (   $level = null)

Set the logging level.

Parameters
mixed$levelLevel
Returns
void

Definition at line 168 of file Logger.php.

Elgg\Logger::warn (   $message,
array  $context = [] 
)

Log message at the WARNING level.

Parameters
string$messageThe message to log
array$contextContext
Returns
bool

Definition at line 326 of file Logger.php.

Elgg\Logger::warning (   $message,
array  $context = [] 
)

{}

Definition at line 292 of file Logger.php.

Member Data Documentation

Elgg\Logger::$elgg_levels
staticprotected
Initial value:
= [
0 => false

Definition at line 35 of file Logger.php.

Elgg\Logger::$hooks
protected

Definition at line 67 of file Logger.php.

Elgg\Logger::$legacy_levels
staticprotected
Initial value:
= [
'OFF' => false

Definition at line 51 of file Logger.php.

Elgg\Logger::$level
protected

Definition at line 62 of file Logger.php.

const Elgg\Logger::CHANNEL = 'ELGG'

Definition at line 27 of file Logger.php.

const Elgg\Logger::OFF = false

Definition at line 29 of file Logger.php.


The documentation for this class was generated from the following file: