PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 1.4.6
Backup Migration v1.4.6
2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / includes / logger.php
backup-backup / includes Last commit date
banner 1 year ago check 1 year ago cli 1 year ago cron 1 year ago dashboard 1 year ago database 1 year ago extracter 1 year ago htaccess 1 year ago progress 1 year ago scanner 1 year ago staging 1 year ago uploader 1 year ago zipper 1 year ago .htaccess 1 year ago activation.php 1 year ago ajax.php 1 year ago analyst.php 1 year ago backup-process.php 1 year ago cli-handler.php 1 year ago compatibility.php 1 year ago config.php 1 year ago constants.php 1 year ago initializer.php 1 year ago logger.php 1 year ago
logger.php
47 lines
1 <?php
2
3 // Namespace
4 namespace BMI\Plugin;
5
6 // Exit on direct access
7 if (!defined('ABSPATH')) exit;
8
9 /**
10 * Main Plugin Logger
11 */
12 class BMI_Logger {
13
14 public static function append($type, $log) {
15
16 $configDir = BMI_CONFIG_DIR . DIRECTORY_SEPARATOR . 'complete_logs.log';
17 if (is_dir(dirname($configDir)) && file_exists($configDir)) {
18 $date = '[' . date('Y-m-d H:i:s') . '] ';
19 $file = fopen($configDir, 'a');
20 fwrite($file, $date . $type . ' ' . $log . "\n");
21 fclose($file);
22 }
23
24 }
25
26 public static function log($log) {
27
28 BMI_Logger::append('[LOG]', $log);
29
30 }
31
32 public static function error($log) {
33
34 BMI_Logger::append('[ERROR]', $log);
35
36 }
37
38 public static function debug($log) {
39
40 if (BMI_DEBUG === TRUE) {
41 BMI_Logger::append('[DEBUG]', $log);
42 }
43
44 }
45
46 }
47