5 if ( ! defined(
'GRAVITYVIEW_DIR' ) ) {
30 protected function log( $level, $message, $context ) {
31 $backtrace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 3 );
32 $location = $this->interpolate(
"{class}{type}{function}", $backtrace[2] );
33 $message = $this->interpolate(
"[$level, $location] $message", $context );
36 case LogLevel::EMERGENCY:
38 case LogLevel::CRITICAL:
42 case LogLevel::WARNING:
43 case LogLevel::NOTICE:
50 if ( defined(
'DOING_GRAVITYVIEW_TESTS' ) ) {
53 sprintf(
'gravityview_log_%s_test', $action ),
54 $this->interpolate( $message, $context ),
55 empty( $context[
'data'] ) ? array() : $context[
'data']
60 sprintf(
'gravityview_log_%s', $action ),
61 $this->interpolate( $message, $context ),
62 empty( $context[
'data'] ) ? array() : $context[
'data']
If this file is called directly, abort.
log( $level, $message, $context)
Logs with an arbitrary level using do_action and our old action handlers.