Skip to content

Commit

Permalink
Add angular example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
philmander committed Aug 2, 2016
1 parent 251ecd4 commit 0dd9ee4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The code also contains a dedicated browser console stream. Use it like this:
```javascript
var bunyan = require('./lib/bunyan');
var log = bunyan.createLogger({
name: 'play',
name: 'myLogger',
streams: [
{
level: 'info',
Expand All @@ -21,6 +21,24 @@ var log = bunyan.createLogger({
log.info('hi on info');
```

Angular example:

```javascript
adminApp.config(function($provide) {
$provide.decorator('$log', function($delegate) {
$delegate = bunyan.createLogger({
name: 'myLogger',
streams: [{
level: 'info',
stream: new bunyan.ConsoleFormattedStream(),
type: 'raw'
}]
});
return $delegate;
});
});
```

Docs are the Bunyan docs at time of forking, with the documentation for the stripped features also removed:

=====================================
Expand Down

0 comments on commit 0dd9ee4

Please sign in to comment.