Logging stream. More...
#include <iosfwd>
#include <sstream>
Go to the source code of this file.
Classes | |
class | SgDebugToNewFile |
Temporarily redirect IO to file for lifetime of this object. More... | |
class | SgDebugToString |
Temporarily redirect IO to a string buffer for lifetime of this object. More... | |
Functions | |
std::ostream & | SgDebug () |
Current logging stream. | |
std::ostream & | SgWarning () |
Write warning prefix to logging stream and return it. | |
void | SgDebugToFile (const char *filename) |
Set logging stream to file. | |
void | SgDebugToNull () |
Set logging stream to null stream. | |
void | SgDebugToWindow () |
Set logging stream to console window. | |
std::ostream * | SgSwapDebugStr (std::ostream *newStr) |
Logging stream.
Definition in file SgDebug.h.
std::ostream& SgDebug | ( | ) |
Current logging stream.
Definition at line 27 of file SgDebug.cpp.
References SG_ASSERT.
Referenced by SgSearch::AddSequenceToHash(), SgSearch::CallEvaluate(), SgSearch::CallExecute(), SgSearch::CallGenerate(), SgSearch::CallTakeBack(), SgGtpCommands::CmdDebugger(), SgGtpCommands::CmdExec(), SgUctTree::CopySubtree(), SgUctSearch::Debug(), SgThreadedWorker< I, O, W >::DoWork(), SgSearch::LookupHash(), SgUctSearch::Thread::operator()(), SgTimeRecord::PlayedMove(), SgUctSearch::PrintSearchProgress(), SgUctSearch::Search(), SgUctSearch::SearchOnePly(), SgGtpClient::Send(), SgUctTree::SetMaxNodes(), SgRandom::SetSeed(), SgWarning(), SgSearch::StartOfDepth(), SgSearch::StoreHash(), SgUctTree::ThrowConsistencyError(), SgDefaultTimeControl::TimeForCurrentMove(), SgTimeRecord::UpdateTimeLeft(), SgEvaluatedMovesArray::Write(), and SgThreadedWorker< I, O, W >::~SgThreadedWorker().
void SgDebugToFile | ( | const char * | filename | ) |
void SgDebugToNull | ( | ) |
Set logging stream to null stream.
Discards everything written to SgDebug().
Definition at line 58 of file SgDebug.cpp.
References s_nullStream.
Referenced by SgGtpCommands::CmdQuiet().
void SgDebugToWindow | ( | ) |
Set logging stream to console window.
Definition at line 46 of file SgDebug.cpp.
References cerr.
std::ostream* SgSwapDebugStr | ( | std::ostream * | newStr | ) |
Definition at line 63 of file SgDebug.cpp.
Referenced by SgGtpCommands::CmdQuiet(), SgDebugToNewFile::SetFile(), SgDebugToString::SgDebugToString(), SgDebugToNewFile::~SgDebugToNewFile(), and SgDebugToString::~SgDebugToString().
std::ostream& SgWarning | ( | ) |
Write warning prefix to logging stream and return it.
Writes "WARNING: " to the logging stream and returns it for outputting the rest of the warning line. Lines beginning with this prefix are displayed in a different color than regular stderr output in GoGui.
Definition at line 38 of file SgDebug.cpp.
References SgDebug().
Referenced by SgGameWriter::HandleProps(), and SgUctSearch::StartSearch().