seneca-log-filter

    0.1.0 • Public • Published

    Seneca

    A Seneca.js Log Filter Module

    seneca-log-filter

    npm version Build Status Coverage Status Dependency Status Gitter chat

    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 out
      • omit-metadata a value which can be true or false, if true this omits the properties with the names seneca, level and when when filtering an object
      • omit 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

    License

    Copyright (c) 2016, David Gonzalez. Licensed under MIT.

    Install

    npm i seneca-log-filter

    DownloadsWeekly Downloads

    821

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • dagonza
    • mihaidma