Merge pull request #6548 from zacps/logging-docs-6346

Remove examples of Log::add_writer() (fixes #6346)
This commit is contained in:
Daniel Hensby 2017-01-24 16:38:36 +00:00 committed by GitHub
commit 8a19eb84df

View File

@ -18,36 +18,7 @@ use SilverStripe\Dev\Deprecation;
* - Log::NOTICE
* - Log::INFO
* - Log::DEBUG
*
* You can add an error writer by calling {@link Log::add_writer()}
*
* Example usage of logging errors by email notification:
* <code>
* Log::add_writer(new LogEmailWriter('my@email.com'), Log::ERR);
* </code>
*
* Example usage of logging errors by file:
* <code>
* Log::add_writer(new LogFileWriter('/var/log/silverstripe/errors.log'), Log::ERR);
* </code>
*
* Example usage of logging at warnings and errors by setting the priority to '<=':
* <code>
* Log::add_writer(new LogEmailWriter('my@email.com'), 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 LogErrorEmailFormatter} is such an example that formats errors
* into HTML for human readability in an email client.
*
* Formatters are added to writers like this:
* <code>
* $logEmailWriter = new LogEmailWriter('my@email.com');
* $myEmailFormatter = new MyLogEmailFormatter();
* $logEmailWriter->setFormatter($myEmailFormatter);
* </code>
*/
*/
class Log
{