Skip to content

Commit

Permalink
Outputlogger: fix callbacks when console is disabled; cout instead of…
Browse files Browse the repository at this point in the history
… stdout
  • Loading branch information
jlblancoc committed Aug 22, 2016
1 parent 7f50d63 commit 512833e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/base/src/utils/COutputLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ void COutputLogger::logStr(const VerbosityLevel level, const std::string& msg_st

if (logging_enable_console_output) {
msg.dumpToConsole();

// User callbacks:
for (const auto &c : m_listCallbacks)
(*c.func)(msg.body,msg.level,msg.name,msg.timestamp,c.userParam);
}

// User callbacks:
for (const auto &c : m_listCallbacks)
(*c.func)(msg.body,msg.level,msg.name,msg.timestamp,c.userParam);
}

void COutputLogger::logFmt(const VerbosityLevel level, const char* fmt, ...) const {
Expand Down Expand Up @@ -248,7 +248,7 @@ void COutputLogger::TMsg::dumpToConsole() const {
if (concol!=CONCOL_NORMAL)
mrpt::system::setConsoleColor(concol, dump_to_cerr);
// Output msg:
::fputs(str.c_str(), dump_to_cerr ? stderr:stdout );
(dump_to_cerr ? std::cerr : std::cout) << str;
// Switch back to normal color:
if (concol!=CONCOL_NORMAL)
mrpt::system::setConsoleColor(CONCOL_NORMAL);
Expand Down

0 comments on commit 512833e

Please sign in to comment.