PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
← All changes | inc/class-lp-debug.php +14 -7 4.1.6.94.4.8 View file →
@@ -21,9 +21,8 @@
21 21 /**
22 22 * Constructor for the logger.
23 23 */
24 24 protected function __construct() {
25 -
26 25 }
27 26
28 27 /**
29 28 * @var bool
@@ -30,9 +29,8 @@
30 29 */
31 30 protected static $_transaction_started = false;
32 31
33 32 public function output() {
34 -
35 33 }
36 34
37 35 /**
38 36 * Set time start
@@ -126,16 +124,25 @@
126 124
127 125 /**
128 126 * Set error log
129 127 *
130 - * @param string $message
128 + * @param Throwable $e
131 129 *
132 130 * @return void
131 + * @version 1.0.1
132 + * @since 3.0.0
133 133 */
134 - public static function error_log( string $message ) {
135 - if ( LP_Debug::is_debug() ) {
136 - error_log( $message );
137 - }
134 + public static function error_log( Throwable $e ) {
135 + error_log( sprintf( 'MESSAGE: %s FILE: %s LINE: %s', $e->getMessage(), $e->getFile(), $e->getLine() ) );
136 + }
137 +
138 + public static function log_to_comment( $comment_content ) {
139 + wp_insert_comment(
140 + [
141 + 'comment_content' => $comment_content,
142 + 'comment_type' => 'lp_debug_log',
143 + ]
144 + );
138 145 }
139 146
140 147 /**
141 148 * @return LP_Debug|null