Added warning method. Changed some code to use it.

This commit is contained in:
Rudi Grinberg 2012-08-27 14:51:35 -04:00
parent 1a13731216
commit 7aba1dcebd
2 changed files with 16 additions and 1 deletions

View File

@ -51,6 +51,21 @@ class Logging {
$logger = self::getLogger();
$logger->info("[$file : $function() : line $line] - ".self::toString($p_msg));
}
public static function warn($p_msg)
{
$bt = debug_backtrace();
$caller = array_shift($bt);
$file = basename($caller['file']);
$line = $caller['line'];
$caller = array_shift($bt);
$function = $caller['function'];
$logger = self::getLogger();
$logger->info("[$file : $function() : line $line] [WARN] - ".self::toString($p_msg));
}
public static function debug($p_msg)
{

View File

@ -128,7 +128,7 @@ class Application_Model_StoredFile
if (defined($mdConst)) {
$dbMd[constant($mdConst)] = $mdValue;
} else {
Logging::info("Warning: using metadata that is not defined.
Logging::warn("using metadata that is not defined.
[$mdConst] => [$mdValue]");
}
}