Plop
A simple logging library for PHP
Plop\LoggerInterface Interface Reference

Interface for a logger. More...

+ Inheritance diagram for Plop\LoggerInterface:

Public Member Functions

 alert ($msg, array $args=array(),\Exception $exception=null)
 
 critical ($msg, array $args=array(),\Exception $exception=null)
 
 debug ($msg, array $args=array(),\Exception $exception=null)
 
 emergency ($msg, array $args=array(),\Exception $exception=null)
 
 error ($msg, array $args=array(),\Exception $exception=null)
 
 exception ($msg,\Exception $exception, array $args=array())
 
 getClass ()
 
 getFilters ()
 
 getHandlers ()
 
 getLevel ()
 
 getMethod ()
 
 getNamespace ()
 
 getRecordFactory ()
 
 info ($msg, array $args=array(),\Exception $exception=null)
 
 isEnabledFor ($level)
 
 log ($level, $msg, array $args=array(),\Exception $exception=null)
 
 notice ($msg, array $args=array(),\Exception $exception=null)
 
 setFilters (\Plop\FiltersCollectionAbstract $filters)
 
 setHandlers (\Plop\HandlersCollectionAbstract $handlers)
 
 setLevel ($level)
 
 setRecordFactory (\Plop\RecordFactoryInterface $factory)
 
 warn ($msg, array $args=array(),\Exception $exception=null)
 
 warning ($msg, array $args=array(),\Exception $exception=null)
 

Detailed Description

Interface for a logger.

Definition at line 27 of file LoggerInterface.php.

Member Function Documentation

Plop\LoggerInterface::alert (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::ALERT log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::critical (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::CRITICAL log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::debug (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::DEBUG log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::emergency (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::EMERGENCY log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::error (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::ERROR log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::exception (   $msg,
\Exception  $exception,
array  $args = array() 
)

Log an exception.

Parameters
string$msgThe message to log.
Exception$exceptionAn exception that should also be logged. The exception's stack trace will be included in the final message.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).
Note
The message containing the exception will be logged with the Plop::ERROR log level. To log it using another log level, call another logging method and pass the exception as the value for the $exception argument.

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::getClass ( )

Return the name of the class this logger applies to.

Return values
stringName of the class this logger relates to.
See also
Plop::LoggerInterface::getNamespace() and Plop::LoggerInterface::getMethod().

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::getFilters ( )

Get the collection of filters currently associated with this logger.

Return values
Plop::FiltersCollectionAbstractCollection of filters associated with this logger.

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::getHandlers ( )

Get the collection of handlers currently associated with this logger.

Return values
Plop::HandlersCollectionAbstractCollection of handlers associated with this logger.

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::getLevel ( )

Return the minimum level a log record must have to be handled by this class.

Return values
intMinimum level at which log records will be accepted.

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::getMethod ( )

Return the name of the method or function this logger applies to.

Return values
stringName of the method/function this logger relates to.
See also
Plop::LoggerInterface::getNamespace() and Plop::LoggerInterface::getClass().

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::getNamespace ( )

Return the name of the namespace this logger applies to.

Return values
stringName of the namespace this logger relates to.
See also
Plop::LoggerInterface::getClass() and Plop::LoggerInterface::getMethod().

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::getRecordFactory ( )

Return the factory used to produce log records.

Return values
Plop::RecordFactoryInterfaceThe factory used to produce records.

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::info (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::INFO log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::isEnabledFor (   $level)

Return a flag indicating whether a log with the given level would be handled by this instance.

Parameters
int | string$levelLevel to test.
Return values
booltrue if a log with the given level would be handled by this instance, or false if it would be ignored.

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::log (   $level,
  $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the given log level.

Parameters
int$levelThe log level for the message. This argument is only useful for custom log levels. For pre-defined levels, you should consider using the following shortcut methods:
string$msgThe message to log (possibly with special sequences to embed formatted values from the $args parameter). The exact sequence used to embed values depends on the interpolator in use. For the default interpolator (Plop::Interpolator::Percent), each sequence must follow this model:
%(name)<spec> 
where name is the key of the variable, taken from the $args parameter, and <spec> is a valid sprintf() format specification, such as
%(foo)04d 
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::notice (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::NOTICE log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::setFilters ( \Plop\FiltersCollectionAbstract  $filters)

Set the collection of filters associated with this logger.

Parameters
Plop::FiltererInterface$filtersNew collection of filters to associate with this logger.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::setHandlers ( \Plop\HandlersCollectionAbstract  $handlers)

Set the collection of handlers associated with this logger.

Parameters
Plop::HandlersCollectionAbstract$handlersNew collection of handlers to associate with this logger.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::setLevel (   $level)

Set the minimum level a log record must have to be handled by this class.

Parameters
int | string$levelThe new minimum level at which log records will be accepted, either as an integer or as a level name.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::setRecordFactory ( \Plop\RecordFactoryInterface  $factory)

Set the factory to use to produce new log records.

Parameters
Plop::RecordFactoryInterface$factoryThe factory to use to produce records.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\Logger, and Plop\IndirectLoggerAbstract.

Plop\LoggerInterface::warn (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::WARN log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.

Plop\LoggerInterface::warning (   $msg,
array  $args = array(),
\Exception  $exception = null 
)

Log a message with the Plop::WARNING log level.

Parameters
string$msgThe message to log.
array$args(optional) Associative array of values that may be replaced dynamically in the log message. By default, an empty array is used.
Exception | null$exception(optional) An exception that should also be logged. The exception's stack trace will be included in the final message.
Return values
Plop::LoggerInterfaceThe logger instance (ie. $this).

Implemented in Plop\LoggerAbstract.


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