Lines:
1 to 85 of 85
<?php // (C) Copyright Bobbing Wide 2011-2019 if ( !defined( "BWTRACE_INCLUDED" ) ) { define( "BWTRACE_INCLUDED", "3.0.0" ); define( "BWTRACE_FILE", __FILE__ ); /** * Trace library functions * * Library: bwtrace * Provides: bwtrace * Type: MU * */ /** * Constants for bw_trace2's $level parameter * * - The trace record is produced if the $level passed is greater than or equal to the current tracing level ( $bw_trace_on ); * - The default value for bw_trace2 is BW_TRACE_ALWAYS * - The higher you set the value the more tracing you get. * - The testing is NOT (yet) implemented as a bit-mask. * - Note: These values are a subset of logging levels in packages such as monolog. * - It's not really necessary to have CRITICAL, ALERT or EMERGENCY; ERROR will suffice * - See also {@link https://en.wikipedia.org/wiki/Syslog#Severity_levels} * */ if ( !defined( 'BW_TRACE_VERBOSE' ) ) { define( 'BW_TRACE_VERBOSE', 64 ); } if ( !defined( 'BW_TRACE_DEBUG' ) ) { define( 'BW_TRACE_DEBUG', 32 ); } if ( !defined( 'BW_TRACE_INFO' ) ) { define( 'BW_TRACE_INFO', 16 ); } // recommended level if ( !defined( 'BW_TRACE_NOTICE' ) ) { define( 'BW_TRACE_NOTICE', 8 ); } if ( !defined( 'BW_TRACE_WARNING' ) ) { define( 'BW_TRACE_WARNING', 4 ); } if ( !defined( 'BW_TRACE_ERROR' ) ) { define( 'BW_TRACE_ERROR', 2 ); } if ( !defined( 'BW_TRACE_ALWAYS' ) ) { define( 'BW_TRACE_ALWAYS', 0 ); } // bw_trace2() default /** * Assume tracing is off */ if ( !isset( $bw_trace_on )) { if ( defined( 'BW_TRACE_ON' ) ) { $bw_trace_on = BW_TRACE_ON; } else { $bw_trace_on = false; } } /** * Only set trace level if BW_TRACE_LEVEL is defined and it's not already set */ if ( !isset( $bw_trace_level )) { if ( defined( 'BW_TRACE_LEVEL' ) ) { $bw_trace_level = BW_TRACE_LEVEL; } } if ( !function_exists( "bw_trace" ) ) { /* function bw_trace() – Log a simple trace record to the trace log file if tracing is active */ } if ( !function_exists( "bw_trace2" ) ) { /* function bw_trace2() – Trace $value to the trace log file if tracing is active */ } if ( !function_exists( "bw_backtrace" ) ) { /* function bw_backtrace() – Log a debug_backtrace() to the trace log file if tracing is active */ } /** * Start up tracing from the wp-config file if required * * Only do this if the file is available from the current library */ if ( defined( 'BW_TRACE_CONFIG_STARTUP' ) && BW_TRACE_CONFIG_STARTUP == true ) { $bwtrace_boot = __DIR__ . '/bwtrace_boot.php'; if ( file_exists( $bwtrace_boot ) ) { require_once( $bwtrace_boot ); } } } /* end !defined */View on GitHub
Called by
Invoked by
Calls
1 to 3 of 3
Call hooks
API Letters: