-
Notifications
You must be signed in to change notification settings - Fork 63
/
class-logger-html.php
36 lines (33 loc) · 816 Bytes
/
class-logger-html.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
class WP_Importer_Logger_HTML extends WP_Importer_Logger {
/**
* Logs with an arbitrary level.
*
* @param mixed $level
* @param string $message
* @param array $context
* @return null
*/
public function log( $level, $message, array $context = array() ) {
switch ( $level ) {
case 'emergency':
case 'alert':
case 'critical':
echo '<p><strong>' . __( 'Sorry, there has been an error.', 'wordpress-importer' ) . '</strong><br />';
echo esc_html( $message );
echo '</p>';
break;
case 'error':
case 'warning':
case 'notice':
case 'info':
echo '<p>' . esc_html( $message ) . '</p>';
break;
case 'debug':
if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
echo '<p class="debug">' . esc_html( $message ) . '</p>';
}
break;
}
}
}