Completed
Push — master ( 84f8b9...29b389 )
by Angus
08:20
created
application/core/MY_Log.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@  discard block
 block discarded – undo
67 67
 		// detect and register all PHP errors in this log hence forth
68 68
 		ErrorHandler::register($this->log);
69 69
 
70
-		if ($this->config['introspection_processor'])
71
-		{
70
+		if ($this->config['introspection_processor']) {
72 71
 			// add controller and line number info to each log message
73 72
 			// 2 = depth in the stacktrace to ignore. This gives us the file
74 73
 			// making the call to log_message();
@@ -76,10 +75,8 @@  discard block
 block discarded – undo
76 75
 		}
77 76
 
78 77
 		// decide which handler(s) to use
79
-		foreach ($this->config['handlers'] as $value)
80
-		{
81
-			switch ($value)
82
-			{
78
+		foreach ($this->config['handlers'] as $value) {
79
+			switch ($value) {
83 80
 				case 'file':
84 81
 					$handler = new RotatingFileHandler($this->config['file_logfile']);
85 82
 					$formatter = new LineFormatter(null, null, $config['file_multiline']);
@@ -140,35 +137,28 @@  discard block
 block discarded – undo
140 137
 	 * @param $msg
141 138
 	 * @return bool
142 139
 	 */
143
-	public function write_log($level = 'error', $msg)
144
-	{
140
+	public function write_log($level = 'error', $msg) {
145 141
 		$level = strtoupper($level);
146 142
 
147 143
 		// verify error level
148
-		if (!isset($this->_levels[$level]))
149
-		{
144
+		if (!isset($this->_levels[$level])) {
150 145
 			$this->log->addError('unknown error level: ' . $level);
151 146
 			$level = 'ALL';
152 147
 		}
153 148
 
154 149
 		// filter out anything in $this->config['exclusion_list']
155
-		if (!empty($this->config['exclusion_list']))
156
-		{
157
-			foreach ($this->config['exclusion_list'] as $findme)
158
-			{
150
+		if (!empty($this->config['exclusion_list'])) {
151
+			foreach ($this->config['exclusion_list'] as $findme) {
159 152
 				$pos = strpos($msg, $findme);
160
-				if ($pos !== false)
161
-				{
153
+				if ($pos !== false) {
162 154
 					// just exit now - we don't want to log this error
163 155
 					return true;
164 156
 				}
165 157
 			}
166 158
 		}
167 159
 
168
-		if ($this->_levels[$level] <= $this->config['threshold'])
169
-		{
170
-			switch ($level)
171
-			{
160
+		if ($this->_levels[$level] <= $this->config['threshold']) {
161
+			switch ($level) {
172 162
 				case 'ERROR':
173 163
 					$this->log->addError($msg);
174 164
 					break;
Please login to merge, or discard this patch.