Node/Javascript client for the Traceify service on opeNode.io.
npm install traceify-node
As for the configurations, you need an opeNode token and site_name, both are available via the administration dashboard on opeNode:
const traceify = require('traceify-node')({ token: "your token", site_name: "site name here" })
All methods available in traceify returns a promise.
You can log a simple string:
traceify.trace("my simple string begin logged")
or a json:
traceify.trace({ complex: "obj" })
You can log a simple string:
traceify.info("my simple string begin logged")
or a json:
traceify.info({ complex: "obj" })
You can log a simple string:
traceify.warn("my simple string begin logged")
or a json:
traceify.warn({ complex: "obj" })
You can log a simple string:
traceify.debug("my simple string begin logged")
or a json:
traceify.debug({ complex: "obj" })
You can log a simple string:
traceify.error("my simple string begin logged")
or a json:
traceify.error({ complex: "obj" })
You can log using a custom log level:
traceify.log("mylevel", "string or json")
Usually, you will want to create your own logging package on the top of traceify, or use winston with traceity, for example:
const traceify = require('traceify-node')({ token: "your token", site_name: "site name here" })
module.exports = {
mylog: function(level, content) {
traceify.log(level, content).then(() => {
console.log('logged!')
}).catch((err) => {
console.error('there was an issue logging')
console.error(err)
})
}
}
Then everywhere in your application you can just write:
mypackage.mylog('info', 'hello logs!')
ISC