日志接口

属性
命名空间 fize\log
类名 LogHandler
实现接口 Psr\Log\LoggerInterface
方法:
方法名 说明
__construct() 构造函数
emergency() System is unusable.
alert() Action must be taken immediately.
critical() Critical conditions.

|critical() |Critical conditions. | +—————–+————————————————————————————————–+ |error() |Runtime errors that do not require immediate action but should typically be logged and monitored. | +—————–+————————————————————————————————–+ |warning() |Exceptional occurrences that are not errors. | +—————–+————————————————————————————————–+ |notice() |Normal but significant events. | +—————–+————————————————————————————————–+ |info() |Interesting events. | +—————–+————————————————————————————————–+ |debug() |Detailed debug information. | +—————–+————————————————————————————————–+ |log() |Logs with an arbitrary level. | +—————–+————————————————————————————————–+

方法

__construct()

构造函数

abstract public function __construct (
    array $config = []
)
参数:
名称 说明
config 初始化默认选项

emergency()

System is unusable.

abstract public function emergency (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  

alert()

Action must be taken immediately.

abstract public function alert (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  
Example: Entire website down, database unavailable, etc. This should
trigger the SMS alerts and wake you up.

critical()

Critical conditions.

abstract public function critical (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  
Example: Application component unavailable, unexpected exception.

error()

Runtime errors that do not require immediate action but should typically be logged and monitored.

abstract public function error (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  

warning()

Exceptional occurrences that are not errors.

abstract public function warning (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  
Example: Use of deprecated APIs, poor use of an API, undesirable things
that are not necessarily wrong.

notice()

Normal but significant events.

abstract public function notice (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  

info()

Interesting events.

abstract public function info (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  
Example: User logs in, SQL logs.

debug()

Detailed debug information.

abstract public function debug (
    string $message,
    array $context = []
) : void
参数:
名称 说明
message  
context  

log()

Logs with an arbitrary level.

abstract public function log (
    mixed $level,
    string $message,
    array $context = []
) : void
参数:
名称 说明
level  
message  
context