| @@ -17,9 +17,9 @@ | ||
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Returns logger description |
| 20 | 20 | * |
| 21 | - * @return string|void | |
| 21 | + * @return string | |
| 22 | 22 | */ |
| 23 | 23 | public function get_description() { |
| 24 | 24 | return __('Store the most recent log entries in the WordPress database', 'wp-optimize'); |
| 25 | 25 | } |
| @@ -39,11 +39,11 @@ | ||
| 39 | 39 | * Emergency message |
| 40 | 40 | * |
| 41 | 41 | * @param string $message |
| 42 | 42 | * @param array $context |
| 43 | - * @return null|void | |
| 43 | + * @return void | |
| 44 | 44 | */ |
| 45 | - public function emergency($message, array $context = array()) { | |
| 45 | + public function emergency($message, $context = array()) { | |
| 46 | 46 | $this->log($message, Updraft_Log_Levels::EMERGENCY, $context); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| @@ -50,11 +50,11 @@ | ||
| 50 | 50 | * Alert message |
| 51 | 51 | * |
| 52 | 52 | * @param string $message |
| 53 | 53 | * @param array $context |
| 54 | - * @return null|void | |
| 54 | + * @return void | |
| 55 | 55 | */ |
| 56 | - public function alert($message, array $context = array()) { | |
| 56 | + public function alert($message, $context = array()) { | |
| 57 | 57 | $this->log($message, Updraft_Log_Levels::ALERT, $context); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
| @@ -61,11 +61,11 @@ | ||
| 61 | 61 | * Critical message |
| 62 | 62 | * |
| 63 | 63 | * @param string $message |
| 64 | 64 | * @param array $context |
| 65 | - * @return null|void | |
| 65 | + * @return void | |
| 66 | 66 | */ |
| 67 | - public function critical($message, array $context = array()) { | |
| 67 | + public function critical($message, $context = array()) { | |
| 68 | 68 | $this->log($message, Updraft_Log_Levels::CRITICAL, $context); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
| @@ -72,11 +72,11 @@ | ||
| 72 | 72 | * Error message |
| 73 | 73 | * |
| 74 | 74 | * @param string $message |
| 75 | 75 | * @param array $context |
| 76 | - * @return null|void | |
| 76 | + * @return void | |
| 77 | 77 | */ |
| 78 | - public function error($message, array $context = array()) { | |
| 78 | + public function error($message, $context = array()) { | |
| 79 | 79 | $this->log($message, Updraft_Log_Levels::ERROR, $context); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| @@ -83,11 +83,11 @@ | ||
| 83 | 83 | * Warning message |
| 84 | 84 | * |
| 85 | 85 | * @param string $message |
| 86 | 86 | * @param array $context |
| 87 | - * @return null|void | |
| 87 | + * @return void | |
| 88 | 88 | */ |
| 89 | - public function warning($message, array $context = array()) { | |
| 89 | + public function warning($message, $context = array()) { | |
| 90 | 90 | $this->log($message, Updraft_Log_Levels::WARNING, $context); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| @@ -94,11 +94,11 @@ | ||
| 94 | 94 | * Notice message |
| 95 | 95 | * |
| 96 | 96 | * @param string $message |
| 97 | 97 | * @param array $context |
| 98 | - * @return null|void | |
| 98 | + * @return void | |
| 99 | 99 | */ |
| 100 | - public function notice($message, array $context = array()) { | |
| 100 | + public function notice($message, $context = array()) { | |
| 101 | 101 | $this->log($message, Updraft_Log_Levels::NOTICE, $context); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
| @@ -105,11 +105,11 @@ | ||
| 105 | 105 | * Info message |
| 106 | 106 | * |
| 107 | 107 | * @param string $message |
| 108 | 108 | * @param array $context |
| 109 | - * @return null|void | |
| 109 | + * @return void | |
| 110 | 110 | */ |
| 111 | - public function info($message, array $context = array()) { | |
| 111 | + public function info($message, $context = array()) { | |
| 112 | 112 | $this->log($message, Updraft_Log_Levels::INFO, $context); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| @@ -116,11 +116,11 @@ | ||
| 116 | 116 | * Debug message |
| 117 | 117 | * |
| 118 | 118 | * @param string $message |
| 119 | 119 | * @param array $context |
| 120 | - * @return null|void | |
| 120 | + * @return void | |
| 121 | 121 | */ |
| 122 | - public function debug($message, array $context = array()) { | |
| 122 | + public function debug($message, $context = array()) { | |
| 123 | 123 | $this->log($message, Updraft_Log_Levels::DEBUG, $context); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
| @@ -128,15 +128,15 @@ | ||
| 128 | 128 | * |
| 129 | 129 | * @param string $message |
| 130 | 130 | * @param mixed $level |
| 131 | 131 | * @param array $context |
| 132 | - * @return null|void | |
| 132 | + * @return void | |
| 133 | 133 | */ |
| 134 | - public function log($message, $level, array $context = array()) { | |
| 134 | + public function log($message, $level, $context = array()) { | |
| 135 | 135 | |
| 136 | - if (!$this->is_enabled()) return false; | |
| 136 | + if (!$this->is_enabled()) return; | |
| 137 | 137 | |
| 138 | - $message = date("Y-m-d H:i:s").' ['.Updraft_Log_Levels::to_text($level).'] : '.$this->interpolate($message, $context); | |
| 138 | + $message = gmdate("Y-m-d H:i:s").' ['.Updraft_Log_Levels::to_text($level).'] : '.$this->interpolate($message, $context); | |
| 139 | 139 | $this->add_log($message); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
| @@ -173,9 +173,9 @@ | ||
| 173 | 173 | return $this->get_option('ring_logger_limit', 20); |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
| 177 | - * Set logger wordpress option name where log will stored | |
| 177 | + * Set logger WordPress option name where log will be stored | |
| 178 | 178 | * |
| 179 | 179 | * @param string $option_name Name for logger option. |
| 180 | 180 | */ |
| 181 | 181 | public function set_logger_option_name($option_name) { |
| @@ -184,9 +184,9 @@ | ||
| 184 | 184 | |
| 185 | 185 | /** |
| 186 | 186 | * Return log content |
| 187 | 187 | * |
| 188 | - * @return mixed|void | |
| 188 | + * @return mixed | |
| 189 | 189 | */ |
| 190 | 190 | public function get_log() { |
| 191 | 191 | return get_option($this->get_logger_option_name(), array()); |
| 192 | 192 | } |