Gumbo_Log



Log Class

The Log class receives all Log_Message objects from the program. The Message must be an active type (or ignore types on). When the program is ready, simply call the 'write' method to save all the Message into a file. Once written, the messages are removed.

The class implements the Lockable Interface. This lock only applies to Message Types. Once set, it cannot be unlocked from outside the class. This helps to ensure that additional Log Types are not added in other locations of the program.

Author(s): Michael Luster <mluster79@yahoo.com>
License:New BSD License
Copyright:Copyright (c) 2007, iBayou, Michael Luster
Link:http://sourceforge.net/projects/phpgumbo
Version:0.0.1

Implements interfaces:

Class Variables

static Gumbo_Interface_Singleton $_instance =  null [line 50]
bool $_ignore =  false [line 60]
bool $_locked =  false [line 63]
Gumbo_Log_Message[] $_messages = array () [line 53]
bool $_status =  false [line 55]
array $_types = array () [line 58]

Class Methods

public static Gumbo_Interface_Log instance ( ) [line 76]

Singleton Method


[ Top ]
private Gumbo_Log __construct ( ) [line 70]

Constructor


[ Top ]
public void add ( Gumbo_Log_Message $mess ) [line 124]

Adds a log message to the list

Parameter(s):

  • (Gumbo_Interface_Log_Message) $mess
  • precondition:  isOn()
Implementation of:
Gumbo_Interface_Log::add()

[ Top ]
public void addType ( string $type ) [line 167]

Adds an active Log Message Type

Parameter(s):

  • (string) $type
  • precondition:  Type is not set
  • precondition:  !isLocked()
Implementation of:
Gumbo_Interface_Log::addType()

[ Top ]
public void clear ( ) [line 141]

Clears the log messages in the system

Implementation of:
Gumbo_Interface_Log::clear()

[ Top ]
public void delType ( string $type ) [line 193]

Removes an active Log Message Type

Parameter(s):

  • (string) $type
  • precondition:  Type set
  • precondition:  !isLocked()
Implementation of:
Gumbo_Interface_Log::delType()

[ Top ]
public array getAll ( ) [line 253]

Returns all the log messages

Implementation of:
Gumbo_Interface_Log::getAll()

[ Top ]
public array getTypes ( ) [line 261]

Returns all the registered message types

Implementation of:
Gumbo_Interface_Log::getTypes()

[ Top ]
public bool ignoreTypes ( [bool $ignore] ) [line 307]

Returns if to ignore Types (or set to ignore Types)

Parameter(s):

  • (bool) $ignore
  • precondition:  !isLocked()
  • throws:  Gumbo_Exception
Implementation of:
Gumbo_Interface_Log::ignoreTypes()

[ Top ]
public bool isLocked ( ) [line 331]

Returns if the object is currently locked


[ Top ]
public bool isOn ( ) [line 269]

Returns if Logging is on

Implementation of:
Gumbo_Interface_Log::isOn()

[ Top ]
public bool isType ( string $type ) [line 279]

Returns if the message type is registered

Parameter(s):

  • (string) $type
  • throws:  Gumbo_Exception
Implementation of:
Gumbo_Interface_Log::isType()

[ Top ]
public void lock ( ) [line 242]

Locks an object

  • postcondition:  isLocked()

[ Top ]
public void resetTypes ( ) [line 224]

Resets the types

  • throws:  Gumbo_Exception
  • postcondition:  !getTypes()
  • precondition:  !isLocked()
Implementation of:
Gumbo_Interface_Log::resetTypes()

[ Top ]
public void turnOff ( ) [line 157]

Turn off Logging

  • postcondition:  !isOn()
Implementation of:
Gumbo_Interface_Log::turnOff()

[ Top ]
public void turnOn ( ) [line 149]

Turn on Logging

  • postcondition:  isOn()
Implementation of:
Gumbo_Interface_Log::turnOn()

[ Top ]
public void write ( ) [line 91]

Writes the messages to the corresponding Log file

  • precondition:  isOn()
  • throws:  Gumbo_Exception
Implementation of:
Gumbo_Interface_Log::write()

[ Top ]