Nevertheless Published Mine

    This package has been deprecated

    Author message:

    Deprecated. Use @malijs/logger

    mali-logger

    0.2.2 • Public • Published

    mali-logger

    npm version build status Greenkeeper badge

    Development style logger middleware for Mali.

    --> GetFeature unary
    --> GetFeature unary
    <-- GetFeature unary 22ms
    <-- GetFeature unary 32ms
    --> ListFeatures response_stream
    <-- ListFeatures response_stream 21ms
    --> RecordRoute request_stream
    <-- RecordRoute request_stream 10s
    --> RouteChat duplex
    <-- RouteChat duplex 10ms

    Installation

    $ npm install mali-logger

    Example

    var logger = require('mali-logger')
    var Mali = require('mali')
     
    function sayHello (ctx) {
      ctx.res = { message: 'Hello ' + ctx.req.name }
    }
     
    const app = new Mali(path.resolve(__dirname, './helloworld.proto'), 'Greeter')
    app.use(logger())
    app.use({ sayHello })
    app.start('localhost:50051')

    API

    logger(options)

    options.fullName

    To log full name (fullName) from context, otherwise logs just the name. Default: false.

    app.use(logger({ fullName: true }))

    Output:

    --> /routeguide.RouteGuide/GetFeature unary
    <-- /routeguide.RouteGuide/GetFeature unary 22ms

    Notes

    Recommended that you .use() this middleware near the top to "wrap" all subsequent middleware.

    License

    Apache 2.0

    Install

    npm i mali-logger

    DownloadsWeekly Downloads

    11

    Version

    0.2.2

    License

    Apache-2.0

    Unpacked Size

    16.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • bojand