| @@ -11,8 +11,9 @@ | ||
| 11 | 11 | { |
| 12 | 12 | private static $id = null; |
| 13 | 13 | private static $requestType = null; |
| 14 | 14 | private static $time = -1; |
| 15 | + private static $disabled = false; | |
| 15 | 16 | |
| 16 | 17 | public static function setId($id = null) |
| 17 | 18 | { |
| 18 | 19 | self::$id = $id; |
| @@ -17,8 +18,13 @@ | ||
| 17 | 18 | { |
| 18 | 19 | self::$id = $id; |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | + public static function disable() | |
| 23 | + { | |
| 24 | + self::$disabled = true; | |
| 25 | + } | |
| 26 | + | |
| 21 | 27 | public static function setRequestType($requestType = null) |
| 22 | 28 | { |
| 23 | 29 | self::$requestType = $requestType; |
| 24 | 30 | } |
| @@ -51,8 +57,12 @@ | ||
| 51 | 57 | file_put_contents($log_file, ''); |
| 52 | 58 | } |
| 53 | 59 | public static function write($message, $id = null, $type = 'DEBUG') |
| 54 | 60 | { |
| 61 | + if (self::$disabled) { | |
| 62 | + return; | |
| 63 | + } | |
| 64 | + | |
| 55 | 65 | if (is_null($id) && !is_null(self::$id) && intval(self::$id) > 0) { |
| 56 | 66 | $id = self::$id; |
| 57 | 67 | } |
| 58 | 68 | |