4
0
Эх сурвалжийг харах

Add some helpers to Minz_Log class

Add following methods:
- Minz_Log::debug($msg)
- Minz_Log::notice($msg)
- Minz_Log::warning($msg)
- Minz_Log::error($msg)
Marien Fressinaud 12 жил өмнө
parent
commit
996c387f50
1 өөрчлөгдсөн 17 нэмэгдсэн , 0 устгасан
  1. 17 0
      lib/Minz/Log.php

+ 17 - 0
lib/Minz/Log.php

@@ -80,4 +80,21 @@ class Minz_Log {
 		self::record($msg_get, Minz_Log::DEBUG, $file_name);
 		self::record($msg_get, Minz_Log::DEBUG, $file_name);
 		self::record($msg_post, Minz_Log::DEBUG, $file_name);
 		self::record($msg_post, Minz_Log::DEBUG, $file_name);
 	}
 	}
+
+	/**
+	 * Some helpers to Minz_Log::record() method
+	 * Parameters are the same of those of the record() method.
+	 */
+	public static function debug($msg, $file_name = null) {
+		self::record($msg, Minz_Log::DEBUG, $file_name);
+	}
+	public static function notice($msg, $file_name = null) {
+		self::record($msg, Minz_Log::NOTICE, $file_name);
+	}
+	public static function warning($msg, $file_name = null) {
+		self::record($msg, Minz_Log::WARNING, $file_name);
+	}
+	public static function error($msg, $file_name = null) {
+		self::record($msg, Minz_Log::ERROR, $file_name);
+	}
 }
 }