Skip to content

Instantly share code, notes, and snippets.

@vorandrew
Created November 28, 2017 14:58
Show Gist options
  • Save vorandrew/bdec05eeb832a3ebc5a808430d5a755f to your computer and use it in GitHub Desktop.
Save vorandrew/bdec05eeb832a3ebc5a808430d5a755f to your computer and use it in GitHub Desktop.
Logging is not working
$ node index.js
[-isodate-] INFO init start
[-isodate-] INFO init end
123
var seneca = require('seneca')()
seneca.add({ cmd: 'salestax' }, function (args, callback) {
var rate = 0.23
var total = args.net * (1 + rate)
callback(null, { total: total })
})
seneca.act({ cmd: 'salestax', net: 100 }, function (err, result) {
if (err) return console.error(err)
console.log(result.total)
})
123
{"kind":"notice","notice":"hello seneca 7s5nvcfmqcty/1511881045504/14997/3.4.3/-","level":"info","seneca":"7s5nvcfmqcty/1511881045504/14997/3.4.3/-","when":1511881045570}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment