Definition in file SgDebug.cpp.
#include "SgSystem.h"
#include "SgDebug.h"
#include <fstream>
#include <iostream>
#include <memory>
Go to the source code of this file.
Functions | |
ostream * | g_debugStrPtr (&cerr) |
std::ostream & | SgDebug () |
Current logging stream. | |
std::ostream & | SgWarning () |
Write warning prefix to logging stream and return it. | |
void | SgDebugToWindow () |
Set logging stream to console window. | |
void | SgDebugToFile (const char *filename) |
Set logging stream to file. | |
void | SgDebugToNull () |
Set logging stream to null stream. | |
ostream * | SgSwapDebugStr (ostream *newStr) |
Variables | |
static ofstream | s_nullStream |
Null stream. | |
static auto_ptr< ofstream > | s_fileStream |
ostream* g_debugStrPtr | ( | & | cerr | ) |
Referenced by SgDebug(), SgDebugToFile(), SgDebugToNull(), SgDebugToWindow(), and SgSwapDebugStr().
std::ostream& SgDebug | ( | ) |
Current logging stream.
Definition at line 29 of file SgDebug.cpp.
References g_debugStrPtr(), and 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(), PrintPV(), SgUctSearch::PrintSearchProgress(), SgUctSearch::Search(), SgUctSearch::SearchOnePly(), SgGtpClient::Send(), SgUctTree::SetMaxNodes(), SgRandom::SetSeed(), SgWarning(), SgSearch::StartOfDepth(), SgSearch::StoreHash(), TerminateChild(), SgUctTree::ThrowConsistencyError(), SgDefaultTimeControl::TimeForCurrentMove(), SgTimeRecord::UpdateTimeLeft(), SgEvaluatedMovesArray::Write(), WriteMoves(), and SgThreadedWorker< I, O, W >::~SgThreadedWorker().
void SgDebugToFile | ( | const char * | filename | ) |
Set logging stream to file.
Definition at line 53 of file SgDebug.cpp.
References g_debugStrPtr(), and s_fileStream.
void SgDebugToNull | ( | ) |
Set logging stream to null stream.
Discards everything written to SgDebug().
Definition at line 60 of file SgDebug.cpp.
References g_debugStrPtr(), and s_nullStream.
Referenced by SgGtpCommands::CmdQuiet().
void SgDebugToWindow | ( | ) |
Set logging stream to console window.
Definition at line 48 of file SgDebug.cpp.
References g_debugStrPtr().
ostream* SgSwapDebugStr | ( | ostream * | newStr | ) |
Definition at line 65 of file SgDebug.cpp.
References g_debugStrPtr().
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 40 of file SgDebug.cpp.
References SgDebug().
Referenced by SgGameWriter::HandleProps(), and SgUctSearch::StartSearch().
auto_ptr<ofstream> s_fileStream [static] |
ofstream s_nullStream [static] |
Null stream.
This file stream will never be opened and acts as a null stream for SgDebug().
Definition at line 22 of file SgDebug.cpp.
Referenced by SgDebugToNull().