Skip to content

Commit

Permalink
Simplify log logic
Browse files Browse the repository at this point in the history
- clog and cout are buffered, cerr is not. Use clog instead of cerr.
  • Loading branch information
jean-m-cyr committed Nov 27, 2018
1 parent 13d1be6 commit ad7c36d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libdevcore/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ void dev::simpleDebugOut(std::string const& _s)
{
try
{
std::ostream& os = g_logStdout ? std::cout : std::clog;
if (!g_logNoColor)
{
(g_logStdout ? std::cout : std::cerr) << _s + '\n';
(g_logStdout ? std::cout : std::cerr).flush();
os << _s + '\n';
os.flush();
return;
}
bool skip = false;
Expand All @@ -123,8 +124,8 @@ void dev::simpleDebugOut(std::string const& _s)
ss << it;
}
ss << '\n';
(g_logStdout ? std::cout : std::cerr) << ss.str();
(g_logStdout ? std::cout : std::cerr).flush();
os << ss.str();
os.flush();
}
catch (...)
{
Expand Down

0 comments on commit ad7c36d

Please sign in to comment.