[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Pear/ -> Log.php (sommaire)

$Header: /repository/pear/Log/Log.php,v 1.46 2004/09/09 02:42:22 jon Exp $ $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $

Version: $Revision: 1.46 $
Poids: 635 lignes (19 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Log:: (29 méthodes):
  factory()
  singleton()
  open()
  close()
  flush()
  log()
  emerg()
  alert()
  crit()
  err()
  warning()
  notice()
  info()
  debug()
  _extractMessage()
  priorityToString()
  MASK()
  UPTO()
  setMask()
  getMask()
  _isMasked()
  getPriority()
  setPriority()
  attach()
  detach()
  _announce()
  isComposite()
  setIdent()
  getIdent()


Classe: Log  - X-Ref

The Log:: class implements both an abstraction for various logging
mechanisms and the Subject end of a Subject-Observer pattern.

factory($handler, $name = '', $ident = '', $conf = array()   X-Ref
Attempts to return a concrete Log instance of type $handler.

param: string $handler   The type of concrete Log subclass to return.
param: string $name      The name of the actually log file, table, or
param: string $ident     The identity reported to the log system.
param: array  $conf      A hash containing any additional configuration
param: int $level        Log messages up to and including this level.
return: object Log       The newly created concrete Log instance, or an

singleton($handler, $name = '', $ident = '', $conf = array()   X-Ref
Attempts to return a reference to a concrete Log instance of type
$handler, only creating a new instance if no log instance with the same
parameters currently exists.

You should use this if there are multiple places you might create a
logger, you don't want to create multiple loggers, and you don't want to
check for the existance of one each time. The singleton pattern does all
the checking work for you.

<b>You MUST call this method with the $var = &Log::singleton() syntax.
Without the ampersand (&) in front of the method name, you will not get
a reference, you will get a copy.</b>

param: string $handler   The type of concrete Log subclass to return.
param: string $name      The name of the actually log file, table, or
param: string $ident     The identity reported to the log system.
param: array $conf       A hash containing any additional configuration
param: int $level        Log messages up to and including this level.
return: object Log       The newly created concrete Log instance, or an

open()   X-Ref
Abstract implementation of the open() method.


close()   X-Ref
Abstract implementation of the close() method.


flush()   X-Ref
Abstract implementation of the flush() method.


log($message, $priority = null)   X-Ref
Abstract implementation of the log() method.


emerg($message)   X-Ref
A convenience function for logging a emergency event.  It will log a
message at the PEAR_LOG_EMERG log level.

param: mixed   $message    String or object containing the message
return: boolean True if the message was successfully logged.

alert($message)   X-Ref
A convenience function for logging an alert event.  It will log a
message at the PEAR_LOG_ALERT log level.

param: mixed   $message    String or object containing the message
return: boolean True if the message was successfully logged.

crit($message)   X-Ref
A convenience function for logging a critical event.  It will log a
message at the PEAR_LOG_CRIT log level.

param: mixed   $message    String or object containing the message
return: boolean True if the message was successfully logged.

err($message)   X-Ref
A convenience function for logging a error event.  It will log a
message at the PEAR_LOG_ERR log level.

param: mixed   $message    String or object containing the message
return: boolean True if the message was successfully logged.

warning($message)   X-Ref
A convenience function for logging a warning event.  It will log a
message at the PEAR_LOG_WARNING log level.

param: mixed   $message    String or object containing the message
return: boolean True if the message was successfully logged.

notice($message)   X-Ref
A convenience function for logging a notice event.  It will log a
message at the PEAR_LOG_NOTICE log level.

param: mixed   $message    String or object containing the message
return: boolean True if the message was successfully logged.

info($message)   X-Ref
A convenience function for logging a information event.  It will log a
message at the PEAR_LOG_INFO log level.

param: mixed   $message    String or object containing the message
return: boolean True if the message was successfully logged.

debug($message)   X-Ref
A convenience function for logging a debug event.  It will log a
message at the PEAR_LOG_DEBUG log level.

param: mixed   $message    String or object containing the message
return: boolean True if the message was successfully logged.

_extractMessage($message)   X-Ref
Returns the string representation of the message data.

If $message is an object, _extractMessage() will attempt to extract
the message text using a known method (such as a PEAR_Error object's
getMessage() method).  If a known method, cannot be found, the
serialized representation of the object will be returned.

If the message data is already a string, it will be returned unchanged.

param: mixed $message   The original message data.  This may be a
return: string           The string representation of the message.

priorityToString($priority)   X-Ref
Returns the string representation of a PEAR_LOG_* integer constant.

param: int $priority     A PEAR_LOG_* integer constant.
return: string           The string representation of $level.

MASK($priority)   X-Ref
Calculate the log mask for the given priority.

param: integer   $priority   The priority whose mask will be calculated.
return: integer  The calculated log mask.

UPTO($priority)   X-Ref
Calculate the log mask for all priorities up to the given priority.

param: integer   $priority   The maximum priority covered by this mask.
return: integer  The calculated log mask.

setMask($mask)   X-Ref
Set and return the level mask for the current Log instance.

param: integer $mask     A bitwise mask of log levels.
return: integer          The current level mask.

getMask()   X-Ref
Returns the current level mask.

return: interger         The current level mask.

_isMasked($priority)   X-Ref
Check if the given priority is included in the current level mask.

param: integer   $priority   The priority to check.
return: boolean  True if the given priority is included in the current

getPriority()   X-Ref
Returns the current default priority.

return: integer  The current default priority.

setPriority($priority)   X-Ref
Sets the default priority to the specified value.

param: integer $priority   The new default priority.

attach(&$observer)   X-Ref
Adds a Log_observer instance to the list of observers that are listening
for messages emitted by this Log instance.

param: object    $observer   The Log_observer instance to attach as a
param: boolean   True if the observer is successfully attached.

detach($observer)   X-Ref
Removes a Log_observer instance from the list of observers.

param: object    $observer   The Log_observer instance to detach from
param: boolean   True if the observer is successfully detached.

_announce($event)   X-Ref
Informs each registered observer instance that a new message has been
logged.

param: array     $event      A hash describing the log event.

isComposite()   X-Ref
Indicates whether this is a composite class.

return: boolean          True if this is a composite class.

setIdent($ident)   X-Ref
Sets this Log instance's identification string.

param: string    $ident      The new identification string.

getIdent()   X-Ref
Returns the current identification string.

return: string   The current Log instance's identification string.



Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7