Git Product home page Git Product logo

Comments (5)

ai avatar ai commented on September 23, 2024

What exactly you want to change? :)

Or show your server and logger code.

from server.

nevf avatar nevf commented on September 23, 2024

As per my previous post I've written this simple function:

/** Display spec'd info using the Logux specified logger to the console.
 */
function debug_logger( action, meta, msg ){
    app.reporter.logger.info( { action: action, meta: jsome.getColoredString( meta ) }, msg || '' )
}

I'd like to be able to include other objects in the Bunyan log so something like:

function debug_logger( action, meta, msg, other_obj ){
    app.reporter.logger.info(  { action: action, meta: meta }, msg || '',  other_obj || {} )
or
    app.reporter.logger.info(  { action: action, meta: meta, other_obj: other_obj || {}  }, msg || '')
}

I hope that helps explain things.

from server.

ai avatar ai commented on September 23, 2024

Where and how do you use this debug_logger?

from server.

nevf avatar nevf commented on September 23, 2024

I call it in my server code which uses logux server. For example in app.channel( ..) I call

debug_logger( action, Object.assign( {}, meta, { params: params, creator: creator } ), 'app.channel()' )

so I can include params and creator in the Bunyan log. However it would be much better I could do something like:

debug_logger( action, meta, 'app.channel()', { params: params, creator: creator } )

or something like that.

from server.

ai avatar ai commented on September 23, 2024

In debug_logger you don't need any special support from Logux. Just write directly to Bunyan instance in server.reporter

from server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.