mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Documentation updates to SS_Log
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@94418 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
aebbda34d1
commit
753cafb240
15
dev/Log.php
15
dev/Log.php
@ -14,14 +14,17 @@
|
||||
*
|
||||
* Example usage of logging errors by email notification:
|
||||
* <code>
|
||||
* $logEmailWriter = new SS_LogEmailWriter('my@email.com');
|
||||
* SS_Log::add_writer($logEmailWriter, SS_Log::ERR);
|
||||
* SS_Log::add_writer(new SS_LogEmailWriter('my@email.com'), SS_Log::ERR);
|
||||
* </code>
|
||||
*
|
||||
* Example usage of logging errors by file:
|
||||
* <code>
|
||||
* $logFileWriter = new SS_LogFileWriter('/var/log/silverstripe/errors.log');
|
||||
* SS_Log::add_writer($logFileWriter, SS_Log::ERR);
|
||||
* SS_Log::add_writer(new SS_LogFileWriter('/var/log/silverstripe/errors.log'), SS_Log::ERR);
|
||||
* </code>
|
||||
*
|
||||
* Example usage of logging at warnings and errors by setting the priority to '<=':
|
||||
* <code>
|
||||
* SS_Log::add_writer(new SS_LogEmailWriter('my@email.com'), SS_Log::WARN, '<=');
|
||||
* </code>
|
||||
*
|
||||
* Each writer object can be assigned a formatter. The formatter is
|
||||
@ -100,7 +103,7 @@ class SS_Log {
|
||||
/**
|
||||
* Add a writer instance to the logger.
|
||||
* @param object $writer Zend_Log_Writer_Abstract instance
|
||||
* @param const $priority Priority. Possible values: SS_Log::ERR or SS_Log::WARN
|
||||
* @param const $priority Priority. Possible values: SS_Log::ERR, SS_Log::WARN or SS_Log::NOTICE
|
||||
* @param $comparison Priority comparison operator. Acts on the integer values of the error
|
||||
* levels, where more serious errors are lower numbers. By default this is "=", which means only
|
||||
* the given priority will be logged. Set to "<=" if you want to track errors of *at least*
|
||||
@ -120,7 +123,7 @@ class SS_Log {
|
||||
* error code, error line, error context (backtrace).
|
||||
*
|
||||
* @param string|array $message String of error message, or array of variables
|
||||
* @param const $priority Priority. Possible values: SS_Log::ERR or SS_Log::WARN
|
||||
* @param const $priority Priority. Possible values: SS_Log::ERR, SS_Log::WARN or SS_Log::NOTICE
|
||||
*/
|
||||
public static function log($message, $priority) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user