1 | <?php |
||
3 | final class GravityView_Logging { |
||
4 | |||
5 | private static $errors = array(); |
||
6 | private static $notices = array(); |
||
7 | |||
8 | function __construct() { |
||
21 | |||
22 | /** |
||
23 | * Add integration with the Debug Bar plugin. It's awesome. |
||
24 | * |
||
25 | * @see http://wordpress.org/plugins/debug-bar/ |
||
26 | */ |
||
27 | public function add_debug_bar( $panels ) { |
||
41 | |||
42 | /** |
||
43 | * Enables debug with Gravity Forms logging add-on |
||
44 | * @param array $supported_plugins List of plugins |
||
45 | */ |
||
46 | public function enable_gform_logging( $supported_plugins ) { |
||
50 | |||
51 | /** |
||
52 | * @static |
||
53 | * @return array Array of notices (with `message`, `data`, and `backtrace` keys), if any |
||
54 | */ |
||
55 | public static function get_notices() { |
||
58 | |||
59 | /** |
||
60 | * @static |
||
61 | * @return array Array of errors (with `message`, `data`, and `backtrace` keys), if any |
||
62 | */ |
||
63 | public static function get_errors() { |
||
66 | |||
67 | /** |
||
68 | * Get the name of the function to print messages for debugging |
||
69 | * |
||
70 | * This is necessary because `ob_start()` doesn't allow `print_r()` inside it. |
||
71 | * |
||
72 | * @return string "print_r" or "var_export" |
||
73 | */ |
||
74 | 199 | static function get_print_function() { |
|
83 | |||
84 | 196 | static function log_debug( $message = '', $data = null ) { |
|
102 | |||
103 | 32 | static function log_error( $message = '', $data = null ) { |
|
122 | |||
123 | /** |
||
124 | * Check whether a plugin is active |
||
125 | * |
||
126 | * @param string $plugin |
||
127 | * |
||
128 | * @since 2.5.1 |
||
129 | * |
||
130 | * @param string $plugin The slug for the plugin used when setting up logging (default: "gravityview") |
||
131 | * |
||
132 | * @return bool |
||
133 | */ |
||
134 | static function is_logging_active( $plugin = 'gravityview' ) { |
||
146 | |||
147 | } |
||
148 | |||
150 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.