Giter VIP home page Giter VIP logo

Comments (10)

DennisOSRM avatar DennisOSRM commented on June 16, 2024

Yes, makes sense.

from node-osrm.

DennisOSRM avatar DennisOSRM commented on June 16, 2024

I'll expose a parameter to the library constructor that allows you to mute the logging. Does that make sense to what you have in mind?

from node-osrm.

springmeyer avatar springmeyer commented on June 16, 2024

Yes. Was thinking silent by default and then verbose mode can be turned on. Plan to model this in node-osrm around how node-sqlite3 works.

from node-osrm.

DennisOSRM avatar DennisOSRM commented on June 16, 2024

k, cool. Will dig a bit into node-sqlite3 to get a better impression.

from node-osrm.

springmeyer avatar springmeyer commented on June 16, 2024

node-sqlite has db.on('trace'.. and db.on('profile'.. events you can hook into:

And node-blend has a third arg that is passed to callbacks (which were run in the thread pool) that provides an array of warnings:

These are candidates for how to design ways to get more debugging info. But, on further thought I think this is overkill for now in terms of node-osrm. Just being able to mute things sounds just fine for now!

from node-osrm.

DennisOSRM avatar DennisOSRM commented on June 16, 2024

the current plan is to have a policy singleton that describes if logging is muted or not. And then a simple object that overrides std::ostringstreamoperator<< and which collects output. On destruction, it writes stuff to console. Usage will then be similar to Log().Get(logWarning) << "important message";

from node-osrm.

springmeyer avatar springmeyer commented on June 16, 2024

okay, sounds good. And familiar to the new boost log and the mapnik debug framework

from node-osrm.

DennisOSRM avatar DennisOSRM commented on June 16, 2024

Right, unfortunately the boost log library is not yet old enough to have trickled down into current linux distros.

from node-osrm.

DennisOSRM avatar DennisOSRM commented on June 16, 2024

This is now implement in Project-OSRM/osrm-backend@44eed92. The default is that logging is disabled. To enable, toggle the that of the LogPolicy singleton class:

LogPolicy::GetInstance().Unmute();

Likewise .Mute() silences any output. Logging messages is as easy as

SimpleLogger().Write() << "super informative message goes here";

whereas .Write() takes a parameter to indicate logging level:

  • logINFO (default)
  • logWARNING
  • logDEBUG

from node-osrm.

springmeyer avatar springmeyer commented on June 16, 2024

fantastic, tests for node-osrm now run cleanly and without noise :)

screen shot 2013-08-08 at 2 26 23 pm

The blue ones are pending, see #8 for details.

from node-osrm.

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.