You appear to be a bot. Output may be restricted
Description
Implements the logging functionValues for $level may be as defined for [github Seldaek monolog]
String | Value | Meaning |
---|---|---|
‘debug’ | 100 | |
‘info’ | 200 | |
‘notice’ | 250 | |
‘warning’ | 300 | |
‘error’ | 400 | |
‘critical’ | 500 | |
‘alert’ | 550 | |
‘emergency’ | 600 | |
BW_TRACE_xxx | standard trace level |
Usage
bw_lazy_log( $value, $text, $show_args, $level );
Parameters
- $value
- ( mixed ) optional – the data to log and trace
- $text
- ( string ) optional – a label for the output
- $show_args
- ( bool ) optional default: 1 – passed to bw_lazy_trace2()
- $level
- ( mixed ) optional default: error –
Returns
voidTO DO
Map the passed trace level to the values expected by trace functionsSource
File name: oik-libs/libs/bwtrace_log.phpLines:
1 to 25 of 25
function bw_lazy_log( $value=null, $text=null, $show_args=true, $level='error' ) { if ( function_exists( "bw_trace_print_r" ) ) { $flat_value = bw_trace_print_r( $value ); } elseif ( is_scalar( $value ) ) { $flat_value = $value; } else { $flat_value = "?"; } if ( is_callable( $level ) ) { $extra = call_user_func( $level, $value, $text ); } else { $extra = $level; } $logged = error_log( "$text:$flat_value:$extra", 0 ); if ( function_exists( "bw_lazy_trace2" ) ) { bw_lazy_trace2( $value, $text, $show_args ); } if ( function_exists( "bw_lazy_backtrace" ) ) { bw_lazy_backtrace(); } return( $value ); }View on GitHub