Stud.IP  trunk Revision
Log Class Reference
Collaboration diagram for Log:
Collaboration graph

Public Member Functions

 __construct ($log_handler=null)
 
 setLogLevel ($level)
 
 getLogLevel ()
 
 setHandler ($log_handler)
 
 getHandler ()
 
 log ($message, $level=Log::ERROR)
 
 __call ($name, $arguments)
 

Static Public Member Functions

static get ($name='')
 
static set ($name='', $log_handler=null)
 
static __callStatic ($name, $arguments)
 

Data Fields

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

Constructor & Destructor Documentation

◆ __construct()

__construct (   $log_handler = null)

create new log instance with given handler

Parameters
mixed$log_handler
Here is the call graph for this function:

Member Function Documentation

◆ __call()

__call (   $name,
  $arguments 
)

magic log, intercepts all undefined method calls called method name must be log level name or part of

Parameters
string$name
array$arguments
Returns
mixed number of written bytes or return value from callable handler
Here is the call graph for this function:

◆ __callStatic()

static __callStatic (   $name,
  $arguments 
)
static

magic log, intercepts all static method calls called method names are splitted by an underscore first part denotes log level, second name of logger if any

Parameters
string$name
array$arguments
Returns
mixed number of written bytes or return value from callable handler

◆ get()

static get (   $name = '')
static

returns a log instance, identified by given name if name is omitted, the default logger is returned

Parameters
string$namename of log instance
Exceptions
InvalidArgumentException
Returns
Log
Here is the caller graph for this function:

◆ getHandler()

getHandler ( )

returns the current log handler

Returns
mixed

◆ getLogLevel()

getLogLevel ( )

returns the current maximum log level

Returns
integer

◆ log()

log (   $message,
  $level = Log::ERROR 
)

log a message

Parameters
string$messagethe log message
integer$levellog level, see constants
Returns
mixed number of written bytes or return value from callable handler
Here is the caller graph for this function:

◆ set()

static set (   $name = '',
  $log_handler = null 
)
static

sets a log handler for the named log instance returns the old handler

Parameters
string$name
mixed$log_handler
Returns
mixed

◆ setHandler()

setHandler (   $log_handler)

set the log handler returns the old handler

Parameters
mixed$log_handler
Returns
mixed
Here is the caller graph for this function:

◆ setLogLevel()

setLogLevel (   $level)

set the maximum log level

Parameters
integer$level
Returns
integer

Field Documentation

◆ ALERT

const ALERT = 1

◆ CRITICAL

const CRITICAL = 2

◆ DEBUG

const DEBUG = 7

◆ ERROR

const ERROR = 3

◆ FATAL

const FATAL = 0

◆ INFO

const INFO = 6

◆ NOTICE

const NOTICE = 5

◆ WARNING

const WARNING = 4

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