13 self::$_logger = LoggerFramework::get_instance(
'gravityview',
'GravityView' );
15 add_action(
'gk/foundation/initialized',
function ( $foundation ) {
16 self::$_logger = $foundation::logger(
'gravityview',
'GravityView' );
20 add_action(
'gravityview_log_error', array( $this,
'log_error'), 10, 2 );
22 add_action(
'gravityview_log_debug', array( $this,
'log_debug'), 10, 2 );
33 if( ob_get_level() > 0 ) {
34 $function =
'var_export';
36 $function =
'print_r';
42 static function log_debug( $message =
'', $data = null ) {
43 $function = self::get_print_function();
45 $message = $function( $message,
true ) . $function($data,
true);
47 self::$_logger->debug( $message );
50 static function log_error( $message =
'', $data = null ) {
51 $function = self::get_print_function();
54 'message' => $message,
56 'backtrace' => function_exists(
'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 3 ) :
'',
59 $message = $function ( $message,
true ) . $function ( $error,
true);
61 self::$_logger->error( $message );
static get_print_function()
Get the name of the function to print messages for debugging.
static log_error( $message='', $data=null)
static log_debug( $message='', $data=null)
(Foundation) Deprecate in future versions or write a wrapper for Foundation Logger so that all method...
Logging framework for GravityKit.