diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php
index 4879e70..d5bec77 100644
--- a/system/codeigniter/Common.php
+++ b/system/codeigniter/Common.php
@@ -153,8 +153,10 @@
 * @access	public
 * @return	void
 */
-function log_message($level = 2, $message, $php_error = FALSE)
+function log_message($level = 'error', $message, $php_error = FALSE)
 {
+	static $LOG;
+	
 	$config =& _get_config();
 	if ($config['log_errors'] === FALSE)
 	{
@@ -166,7 +168,7 @@
 		include_once(BASEPATH.'libraries/Log.php');		
 	}
 	
-	if ( ! isset($LOG))
+	if ( ! is_object($LOG))
 	{
 		$LOG = new CI_Log(
 							$config['log_path'],