Skip to content

Commit

Permalink
add custom logger example
Browse files Browse the repository at this point in the history
  • Loading branch information
StarpTech committed Dec 2, 2016
1 parent ac92e69 commit 10dd333
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/custom-logger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict'

const Hemera = require('./../')
const nats = require('nats').connect()

let logger = {
info: function(msg) {
console.log(msg);
}
}

const hemera = new Hemera(nats, { logLevel: 'info', logger })

hemera.ready(() => {

hemera.act({ topic: 'math', cmd: 'add', a: 1, b: 2 }, function (err, resp) {

this.log.info('Result', resp)
})

})

0 comments on commit 10dd333

Please sign in to comment.