shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

Support for redirecting the logs #3718

Open vigsterkr opened 7 years ago

vigsterkr commented 7 years ago

currently the SG_DEBUG/INFO etc logging methods are streaming the output std::cout. It would be good to be able to have file output of the logs, as for example in case of the unit testing framework all the DEBUG information is lost as gtest is swallowing all the std::cout.

some of the options worth checking out:

the latter one has the advantage that it's a header only solution, i.e. we could simply bundle it during compile time if need be.

MikeLing commented 7 years ago

Where should we put these log file?

vigsterkr commented 7 years ago

@MikeLing i'm not so sure if i understand you... those libraries support specifying as a config variable to print the logs into a file instead of stdout/err

MikeLing commented 7 years ago

@vigsterkr yeah, I know, I mean we need someplace to store those log files right? Like we need a folder named log located in shogun/src/shogun and so we know where to find that log file.

vigsterkr commented 7 years ago

@MikeLing still not sure if i understand you.... i mean what does that have to do where the logs file is being put in the context of this task? that should be up to the user of shogun... it's a runtime configuration of either glog, spdlog or any of the logging library one chooses to use