23 #ifndef COM_DAFER45_TBTK_STREAMS
24 #define COM_DAFER45_TBTK_STREAMS
70 static std::ostream
out;
73 static std::ostream
log;
76 static std::ostream
err;
87 static void openLog(std::string filename =
"TBTKLog");
96 static class NullBuffer :
public std::streambuf{
102 class ForkBuffer :
public std::streambuf{
106 std::basic_ostream<
char, std::char_traits<char>> *ostream1,
107 std::basic_ostream<
char, std::char_traits<char>> *ostream2
111 void mute(
int n,
bool isMute);
114 std::basic_ostream<char, std::char_traits<char>> *ostreams[2];
125 class LogBuffer :
public std::streambuf{
134 void open(std::string fileName);
151 static std::ostream
null;
154 static ForkBuffer stdOutBuffer;
157 static LogBuffer stdLogBuffer;
160 static ForkBuffer stdErrBuffer;
163 static std::ofstream logFile;