mof-genestamp
v3.0.0
Published
middleware of floodesh, prints gene and url of a task, along with # of new tasks and # of records
Downloads
2
Readme
mof-genestamp
middleware of floodesh, prints gene and url of a task, along with # of new tasks and # of records
Install
npm install mof-genestamp
Test
npm test
Usage
In floodesh, use it after parser:
const Worker = require('floodesh').Worker
const genestamp = require('mof-genestamp')
const worker = new Worker(config);
worker.use(co.wrap(worker.parse()));
// refer to the section below
worker.use(genestamp(options));
options
- options
<Object>
Could be undefined. Use 0 to exclude fields. Alternatively, you may specify the inclusion of fields use 1.
log format
`[${ctx.func}] uri=${ctx.opt.uri}, gene.key1=${val1}, gene.key2=[key21=${val21}, key22=${val22}], tasks=${ctx.tasks.length}, dataSet.key1=${len1}, dataSet.key2=${len2}`
Pay attention
no dependency is required for this module, but your the logger instance should be generated by winston@>2.0.0 and your file rotate transport should be generated by winston-daily-rotate-file@>3.2.3
make sure
ctx.opt.gene
does not have a circular reference