hexmakina / log-laddy
LogLaddy 是 PSR-3 Logger Interface 的实现,但主要针对用户界面消息
0.0.7
2021-09-19 13:36 UTC
Requires
- php: >=7.0
- hexmakina/black-box: 0.0.*
- hexmakina/debugger: 0.1.*
- psr/log: 1.1.2
README
LogLaddy 是 PSR-3 Logger Interface 的实现,但主要针对用户界面消息。它依赖于 \Psr\Log\LoggerTrait 和 \HexMakina\Debugger\Debugger
用法
要创建错误和异常之外的消息,首先初始化 LogLaddy,使用兼容的状态代理(用于存储用户消息)
$l = new LogLaddy(StateAgentInterface $agent);
然后调用其中一个消息方法
// for detailed debug information
$l->debug($message, array $context = array())
// for interesting events
$l->info($message, array $context = array())
// for normal but significant events (and success messages)
$l->notice($message, array $context = array())
// for exceptional occurrences that are not errors
$l->warning($message, array $context = array())
// for runtime errors that do not require immediate action but should typically be logged and monitored
$l->error($message, array $context = array())
// for critical condition (Application component unavailable, unexpected exception)
$l->critical($message, array $context = array())
// when action must be taken immediately (website down, database unavailable, etc.)
$l->alert($message, array $context = array())
// when the system is unusable
$l->emergency($message, array $context = array())