summaryrefslogtreecommitdiff
path: root/framework/core.php
diff options
context:
space:
mode:
authorxue <>2006-01-08 20:10:27 +0000
committerxue <>2006-01-08 20:10:27 +0000
commita02e83d8971568617a1723a2bd2b60b79c78faa8 (patch)
treedd7e8c6e2dc2ff661be7dcbb62cba0583ab56fd2 /framework/core.php
parent1ede802243d8532506a05fae3b62e0565fffea84 (diff)
Added documentation.
Diffstat (limited to 'framework/core.php')
-rw-r--r--framework/core.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/framework/core.php b/framework/core.php
index 4c72fca6..13d8318f 100644
--- a/framework/core.php
+++ b/framework/core.php
@@ -715,8 +715,21 @@ class PradoBase
return $language;
}
+ /**
+ * Writes a log message.
+ * This method wraps {@link log()} by checking the application mode.
+ * When the application is in Debug mode, debug backtrace information is appended
+ * to the message and the message is logged at DEBUG level.
+ * When the application is in Performance mode, this method does nothing.
+ * Otherwise, the message is logged at INFO level.
+ * @param string message to be logged
+ * @param string category of the message
+ * @see log, getLogger
+ */
public static function trace($msg,$category='Uncategorized')
{
+ if(self::$_application && self::$_application->getMode()==='Performance')
+ return;
if(!self::$_application || self::$_application->getMode()==='Debug')
{
$trace=debug_backtrace();
@@ -729,6 +742,17 @@ class PradoBase
self::log($msg,$level,$category);
}
+ /**
+ * Logs a message.
+ * Messages logged by this method may be retrieved via {@link TLogger::getLogs}
+ * and may be recorded in different media, such as file, email, database, using
+ * {@link TLogRouter}.
+ * @param string message to be logged
+ * @param integer level of the message. Valid values include
+ * TLogger::DEBUG, TLogger::INFO, TLogger::NOTICE, TLogger::WARNING,
+ * TLogger::ERROR, TLogger::ALERT, TLogger::FATAL.
+ * @param string category of the message
+ */
public static function log($msg,$level=TLogger::INFO,$category='Uncategorized')
{
if(self::$_logger===null)
@@ -736,6 +760,9 @@ class PradoBase
self::$_logger->log($msg,$level,$category);
}
+ /**
+ * @return TLogger message logger
+ */
public static function getLogger()
{
if(self::$_logger===null)