Skip to content

Commit

Permalink
Merge pull request #39 from jbroadway/Echo-handler
Browse files Browse the repository at this point in the history
Added Echo handler to output directly to the console, close #37
  • Loading branch information
lux authored Feb 7, 2020
2 parents 32ccdc8 + 7c016cc commit f6195cd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ with examples for each in the examples folder. These include:
* Apprise - Send notifications through the [apprise](https://github.com/caronc/apprise) command line tool
* Buffer - Buffer messages to send all at once (works with File, Mail, Stderr, and Variable handlers)
* ChromeLogger - Sends messages to [Chrome Logger](http://craig.is/writing/chrome-logger) browser plugin
* Echo - Echo output directly to the console
* File - Append messages to a file
* FirePHP - Send messages to [FirePHP](http://www.firephp.org/) browser plugin
* GELF - Send message to the [Graylog2](http://www.graylog2.org/) log management server
Expand Down
22 changes: 22 additions & 0 deletions lib/Analog/Handler/Echo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Analog\Handler;

/**
* Echo output directly to the console.
*
* Usage:
*
* Analog::handler (Analog\Handler\Echo::init ());
*
* Analog::log ('Log me');
*
* Note: Uses Analog::$format for the output format.
*/
class Echo {
public static function init () {
return function ($info) {
vprintf (\Analog\Analog::$format, $info);
};
}
}

0 comments on commit f6195cd

Please sign in to comment.