Neighborly Package Megalodon

    panda-logger

    1.0.1 • Public • Published

    Panda Logger

    A js json logger.

    Features

    • Prefer FP styles
    • Easy and flexible usages
    • Designed by zhaoyao91

    Install

    npm i panda-logger
    

    Basic Usage

    const { logger } = require('panda-logger')
    
    logger.info('something')
    // {"level": 30, "message": "something"}
    
    logger.warn({foo: 'bar'})
    // {"level": 40, "detail": {"foo": "bar"}}
    
    logger.error(new Error('NOOOO!!!'))
    // {"level": 50, "error": {"name": "Error","message": "NOOOO!!!", "stack": [...]}}
    
    // you can log <message>, <detail>, <error> in any combinations and orders
    logger.fatal(new Error('GOD'), 'oops', [1, 2, 3])
    // {"level": 60, "message": "oops", detail: [1, 2, 3], "error": {"name": "Error","message": "GOD", "stack": [...]}}
    

    All default levels are:

    • verbose (10)
    • debug (20)
    • info (30)
    • warn (40)
    • error (50)
    • fatal (60)

    Public Modules

    See index.js.

    License

    MIT

    Install

    npm i panda-logger

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    17.8 kB

    Total Files

    40

    Last publish

    Collaborators

    • zhaoyao91