FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Log Class Reference
Inheritance diagram for Log:
Component Thing

Public Member Functions

 handler ($name)
 Get a handler. More...
 
 has ($name)
 Check if the log has a specific handler. More...
 
 add ($prio, $message, $filename=null, $line_no=null, $context=null)
 Add a message to the log. More...
 
 start ($prio, $message, $filename=null, $line_no=null, $context=null)
 Add a timer start message to the log. More...
 
 stop ($id, $prio=null, $message=null, $filename=null, $line_no=null, $context=null)
 Stop a timer message. More...
 
 __call ($func_name, $params)
 
 __invoke ($message, $filename=null, $line_no=null, $context=null)
 
- Public Member Functions inherited from Component
 __construct ($fred, $config=null)
 
 __destruct ()
 
 clientConfig ()
 Public configuration. More...
 
 config ($key, $default=null)
 Retrieve a config value. More...
 
 ping ()
 Ping function. More...
 
 filemtime ($filename)
 Filemtime with session cache. More...
 
 component ($name)
 Get a component (local or default). More...
 
 components (... $names)
 Get multiple components in an array. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

const CUSTOM = 10
 Everything above this is only logged when exactly matched. More...
 
const EMERGENCY = 7
 System is unusable. More...
 
const ALERT = 6
 Action must be taken immediately. More...
 
const CRITICAL = 5
 Critical conditions. More...
 
const ERROR = 4
 Error conditions. More...
 
const WARNING = 3
 Warning conditions. More...
 
const NOTICE = 2
 Normal, but significant, condition. More...
 
const INFO = 1
 Informational message. More...
 
const DEBUG = 0
 Debug-level message. More...
 
 $handlers = []
 Array with handlers (key = name, value = config). More...
 
 $ignore = []
 Reg-exp's for concatination of IP + '#' + user agent + '#' + filename + '#' + message to ignore. More...
 
 $break = null
 Reg-exp for message to throw an Exception on. More...
 
- Data Fields inherited from Component
 $filemtimeTtl = 0
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 init ()
 
 context ($filename, $line_no, $context)
 
 _get ($key)
 
- Protected Member Functions inherited from Component
 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Protected Attributes

 $_busy = false
 
 $_timers = []
 
- Protected Attributes inherited from Component
 $_fred = null
 
 $_config = null
 
 $_name = null
 
 $_components = []
 Local components (key = component name, value = component). More...
 
 $_session = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 

Detailed Description

Definition at line 5 of file Log.php.

Member Function Documentation

◆ __call()

__call (   $func_name,
  $params 
)

Definition at line 150 of file Log.php.

◆ __invoke()

__invoke (   $message,
  $filename = null,
  $line_no = null,
  $context = null 
)

Definition at line 155 of file Log.php.

◆ _get()

_get (   $key)
protected

Definition at line 146 of file Log.php.

◆ add()

add (   $prio,
  $message,
  $filename = null,
  $line_no = null,
  $context = null 
)

Add a message to the log.

Parameters
int$prioPriority of the message. Only if this priority surpasses a handlers minimum priority, the message is processed by the handler.
string | Exception$messageMessage to add (if this is an Exception all other parameters will be derived from it).
string | array$filenameFile from which the message originated (or context when no specific file).
int$line_noLine from which the message originated.
array$contextContext for the message. If a key is prefixed with an '@' the value has to be a callback function that returns the real value. This is only done (once) when the message is processed by a handler.

Definition at line 71 of file Log.php.

◆ context()

context (   $filename,
  $line_no,
  $context 
)
protected

Definition at line 56 of file Log.php.

◆ handler()

handler (   $name)

Get a handler.

Parameters
string$nameName of the handler.
Returns
Log\Handler

Definition at line 39 of file Log.php.

◆ has()

has (   $name)

Check if the log has a specific handler.

Parameters
string$nameName of the handler.
Returns
bool True if the log has the specified handler.

Definition at line 52 of file Log.php.

◆ init()

init ( )
protected

Definition at line 24 of file Log.php.

◆ start()

start (   $prio,
  $message,
  $filename = null,
  $line_no = null,
  $context = null 
)

Add a timer start message to the log.

Parameters
int$prioSee add().
string | Exception$messageSee add().
string | array$filenameSee add().
int$line_noSee add().
array$contextSee add().
Returns
string Timer id.

Definition at line 118 of file Log.php.

◆ stop()

stop (   $id,
  $prio = null,
  $message = null,
  $filename = null,
  $line_no = null,
  $context = null 
)

Stop a timer message.

Empty parameters are copied from the start message.

Parameters
string$idTimer id.
int$prioSee add().
string$messageSee add().
string | array$filenameSee add().
int$line_noSee add().
array$contextSee add().

Definition at line 134 of file Log.php.

Field Documentation

◆ $_busy

$_busy = false
protected

Definition at line 21 of file Log.php.

◆ $_timers

$_timers = []
protected

Definition at line 22 of file Log.php.

◆ $break

$break = null

Reg-exp for message to throw an Exception on.

Definition at line 19 of file Log.php.

◆ $handlers

$handlers = []

Array with handlers (key = name, value = config).

Definition at line 17 of file Log.php.

◆ $ignore

$ignore = []

Reg-exp's for concatination of IP + '#' + user agent + '#' + filename + '#' + message to ignore.

Definition at line 18 of file Log.php.

◆ ALERT

const ALERT = 6

Action must be taken immediately.

Definition at line 9 of file Log.php.

◆ CRITICAL

const CRITICAL = 5

Critical conditions.

Definition at line 10 of file Log.php.

◆ CUSTOM

const CUSTOM = 10

Everything above this is only logged when exactly matched.

Definition at line 7 of file Log.php.

◆ DEBUG

const DEBUG = 0

Debug-level message.

Definition at line 15 of file Log.php.

◆ EMERGENCY

const EMERGENCY = 7

System is unusable.

Definition at line 8 of file Log.php.

◆ ERROR

const ERROR = 4

Error conditions.

Definition at line 11 of file Log.php.

◆ INFO

const INFO = 1

Informational message.

Definition at line 14 of file Log.php.

◆ NOTICE

const NOTICE = 2

Normal, but significant, condition.

Definition at line 13 of file Log.php.

◆ WARNING

const WARNING = 3

Warning conditions.

Definition at line 12 of file Log.php.


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