-
Notifications
You must be signed in to change notification settings - Fork 48
Disabling INFO and WARN std::cerr #4
Comments
Yes, makes sense. |
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? |
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. |
k, cool. Will dig a bit into node-sqlite3 to get a better impression. |
And 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! |
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 |
okay, sounds good. And familiar to the new boost log and the mapnik debug framework |
Right, unfortunately the boost log library is not yet old enough to have trickled down into current linux distros. |
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::GetInstance().Unmute(); Likewise SimpleLogger().Write() << "super informative message goes here"; whereas
|
fantastic, tests for node-osrm now run cleanly and without noise :) The blue ones are pending, see #8 for details. |
Ideally, for node-osrm, there could be a way to disable this OSRM output so that meaningful logging could be controlled by the application calling into node-osrm
The text was updated successfully, but these errors were encountered: