3.0.0 • Published 5 years ago

mof-genestamp v3.0.0

Weekly downloads
7
License
ISC
Repository
-
Last release
5 years ago

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

  1. 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

  2. make sure ctx.opt.gene does not have a circular reference

3.0.0

5 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago