seneca-log-filter
v0.1.0
Published
Seneca log filtering module
Downloads
2,486
Readme
A Seneca.js Log Filter Module
seneca-log-filter
- Sponsor: nearForm
Examples
var LogFilter = require('seneca-log-filter')
var filter = LogFilter({'omit-metadata': true, level: 'info' })
var obj = {level: 'info', foo: 'test', bar: 'test' }
var filteredObj = filter(obj)
// filteredObj is equal to {foo: 'test', bar: 'test' }
API
LogFilter(config)
config
is an object which can take several properties which change the behaviour of the filter which are listed below.level
a required property which states the log level to filter outomit-metadata
a value which can be true or false, if true this omits the properties with the namesseneca
,level
andwhen
when filtering an objectomit
an array of strings of names of properties to omit when filtering an object
Returns
A function which can be called on an object to filter properties out of it.
Test
npm test
Contributing
This module follows the general Senecajs org contribution guidelines, and encourages open participation. If you feel you can help in any way, or discover any Issues, feel free to create an issue or create a pull request!
If you wish to read more on our guidelines, feel free to
- Checkout the concise contribution file
- Checkout our much more indepth contributing guidelines
License
Copyright (c) 2016, David Gonzalez. Licensed under MIT.