PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.0
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / includes / Core / Util / Log.php

Log.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 2.0, at includes/Core/Util/Log.php

47 lines 952 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Core\Util;
4
5 final class Log {
6 public static function get_backtrace_info() {
7 $trace = debug_backtrace();
8
9 $file = $trace[1]['file'];
10 $class = $trace[2]['class'];
11 $func = $trace[2]['function'];
12 $type = $trace[2]['type'];
13 $line = $trace[1]['line'];
14
15 $output = sprintf(
16 '%s%s%s() at %s on line %s',
17 $class,
18 $type,
19 $func,
20 $file,
21 $line
22 );
23
24 return $output;
25 }
26
27 public static function debug_log($log) {
28 $trace_info = self::get_backtrace_info();
29 if (WP_DEBUG === true) {
30 if (is_array($log) || is_object($log)) {
31 if (is_array($log)) {
32 $log['trace'] = $trace_info;
33 } else {
34 $log->trace = $trace_info;
35 }
36 $log_msg = print_r($log, true);
37 } else {
38 $log_msg = $log . ' in ' . $trace_info;
39 }
40
41 error_log($log_msg);
42 // var_dump($log_msg);
43 }
44 // die;
45 }
46 }
47