90 public function log( $level, $message, array
$context = [] ) {
91 $message = trim( $message );
93 if ( $this->filter ) {
94 $message = call_user_func( $this->filter, $message, $level,
$context );
95 if ( $message ===
null ) {
100 if ( $this->collect ) {
101 if ( $this->collectContext ) {
102 $this->buffer[] = [ $level, $message,
$context ];
104 $this->buffer[] = [ $level, $message ];
108 case LogLevel::DEBUG:
110 case LogLevel::NOTICE:
111 trigger_error(
"LOG[$level]: $message", E_USER_NOTICE );
114 case LogLevel::WARNING:
115 trigger_error(
"LOG[$level]: $message", E_USER_WARNING );
118 case LogLevel::ERROR:
119 case LogLevel::CRITICAL:
120 case LogLevel::ALERT:
121 case LogLevel::EMERGENCY:
122 trigger_error(
"LOG[$level]: $message", E_USER_ERROR );