| @@ -35,9 +35,9 @@ | ||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function sse_message( $data ) { |
| 38 | 38 | // Log the data into debug log file |
| 39 | - $this->debug_log( $data ); | |
| 39 | + Helper::log( $data ); | |
| 40 | 40 | |
| 41 | 41 | echo "event: message\n"; |
| 42 | 42 | echo 'data: ' . wp_json_encode( $data ) . "\n\n"; |
| 43 | 43 | |
| @@ -44,22 +44,6 @@ | ||
| 44 | 44 | // Extra padding. |
| 45 | 45 | echo esc_html( ':' . str_repeat( ' ', 2048 ) . "\n\n" ); |
| 46 | 46 | |
| 47 | 47 | flush(); |
| 48 | - } | |
| 49 | - | |
| 50 | - /** | |
| 51 | - * Printing Error Logs in debug.log file. | |
| 52 | - * | |
| 53 | - * @param mixed $log | |
| 54 | - * @return void | |
| 55 | - */ | |
| 56 | - public function debug_log( $log ){ | |
| 57 | - if ( defined('TEMPLATELY_EVENT_LOG') && TEMPLATELY_EVENT_LOG === true ) { | |
| 58 | - if ( is_array( $log ) || is_object( $log ) ) { | |
| 59 | - error_log( print_r( $log, true ) ); | |
| 60 | - } else { | |
| 61 | - error_log( $log ); | |
| 62 | - } | |
| 63 | - } | |
| 64 | 48 | } |
| 65 | 49 | } |