PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / trunk
Kubio AI Page Builder vtrunk
2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / vendor / proteusthemes / wp-content-importer-v2 / src / WPImporterLoggerCLI.php
kubio / vendor / proteusthemes / wp-content-importer-v2 / src Last commit date
Importer.php 4 years ago WPImporterLogger.php 4 years ago WPImporterLoggerCLI.php 4 years ago WXRImportInfo.php 4 years ago WXRImporter.php 4 years ago
WPImporterLoggerCLI.php
45 lines
1 <?php
2 namespace ProteusThemes\WPContentImporter2;
3
4 class WPImporterLoggerCLI extends WPImporterLogger {
5 public $min_level = 'notice';
6
7 /**
8 * Logs with an arbitrary level.
9 *
10 * @param mixed $level
11 * @param string $message
12 * @param array $context
13 * @return null
14 */
15 public function log( $level, $message, array $context = array() ) {
16 if ( $this->level_to_numeric( $level ) < $this->level_to_numeric( $this->min_level ) ) {
17 return;
18 }
19
20 printf(
21 '[%s] %s' . PHP_EOL,
22 strtoupper( $level ),
23 $message
24 );
25 }
26
27 public static function level_to_numeric( $level ) {
28 $levels = array(
29 'emergency' => 8,
30 'alert' => 7,
31 'critical' => 6,
32 'error' => 5,
33 'warning' => 4,
34 'notice' => 3,
35 'info' => 2,
36 'debug' => 1,
37 );
38 if ( ! isset( $levels[ $level ] ) ) {
39 return 0;
40 }
41
42 return $levels[ $level ];
43 }
44 }
45