Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Documentation updates to SS_Log (from r94418)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95607 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 3665c59fff0b5eaac9d2307bd655942fee525a1b 1 parent ec20c7a
@halkyon halkyon authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 dev/Log.php
View
15 dev/Log.php
@@ -14,16 +14,19 @@
*
* 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
* responsible for formatting the message before giving it to the writer.
* {@link SS_LogErrorEmailFormatter} is such an example that formats errors
@@ -100,7 +103,7 @@ public static function remove_writer($writer) {
/**
* 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 @@ public static function add_writer($writer, $priority = null, $comparison = '=')
* 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 {

0 comments on commit 3665c59

Please sign in to comment.
Something went wrong with that request. Please try again.