Have ConsoleLogger log to stderr instead of stdout (#1714)
On Unix systems, it's common for programs to read their input from stdin, and write their output to stdout. Messages should be written to stderr, where they won't corrupt a program's output, and where they can be seen by the user even if the output is being redirected. This is mostly a problem when XGBoost is being used from Python or from another program.
This commit is contained in:
parent
6b5a23ccd5
commit
8b9d9669bb
@ -12,7 +12,7 @@ namespace xgboost {
|
|||||||
|
|
||||||
#if XGBOOST_CUSTOMIZE_LOGGER == 0
|
#if XGBOOST_CUSTOMIZE_LOGGER == 0
|
||||||
ConsoleLogger::~ConsoleLogger() {
|
ConsoleLogger::~ConsoleLogger() {
|
||||||
std::cout << log_stream_.str() << std::endl;
|
std::cerr << log_stream_.str() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackerLogger::~TrackerLogger() {
|
TrackerLogger::~TrackerLogger() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user