Closed pnorman closed 3 years ago
There is always Boost logging somewhere near but it seems to be huge and slow to build. Something smaller would be preferrable (non-professional opinion).
boost::log was only introduced in 1.54. This is a big minus.
@zerebubuth, I can't remember the options we came up with at the hack weekend.
There's google's logging library too. I've never used it, though, so I can't say whether it's any good.
The MQ logging library is probably no good for now, as it currently depends on mapnik and that's too big of a dep to pull in (imho). On 27 Feb 2015 20:12, "Paul Norman" notifications@github.com wrote:
boost::log was only introduced in 1.54. This is a big minus.
@zerebubuth https://github.com/zerebubuth, I can't remember the options we came up with at the hack weekend.
— Reply to this email directly or view it on GitHub https://github.com/openstreetmap/osm2pgsql/issues/202#issuecomment-76463478 .
I forgot our library depends on Mapnik. I agree, that rules it out.
log4cxx is another library mentioned, patterned after log4j. log4cxx is packaged on Ubuntu 12.04, 14.04 and FreeBSD
google-glog is Google's. It is packaged on Ubuntu 14.04 and FreeBSD, but not Ubuntu 12.04.
Maybe use something lighweight and header-only like https://github.com/gabime/spdlog , if you are going to use cppformat anyway https://github.com/openstreetmap/osm2pgsql/issues/398 It would be great to replace boost completely, to my opinion. It is the biggest dependency, after all but used only in few places.
Another way is to use boost whenever possible, like https://github.com/alacarte-maps/alacarte (just switched from log4cpp to boost log) and https://github.com/Project-OSRM/osrm-backend (including logging, formatting, testing if needed). Performance and compilation time may suffer a little :)
osmium::util::VerboseOutput might be of use here
Per previous discussion, we need support for three levels of output - details (off by default), standard, and errors.
We might also have additional debugging output with some compile-time flags (e.g. all COPY lines to postgres)
Currently everything prints out with fprintf. This makes it hard to change the verbosity.
Any thoughts?
@zerebubuth, do you think MapQuest/logging would be suited here?