38 |
namespace Debug { |
namespace Debug { |
39 |
|
|
40 |
std::ostream *debugStream() { |
std::ostream *debugStream() { |
41 |
const char *str = std::getenv("VOBLOG"); |
static const char *str = std::getenv("VOBLOG"); |
42 |
static std::ostream *dbgstream = |
static std::ostream *dbgstream = |
43 |
(str ? new std::ofstream(str) : &std::cout); |
(str ? new std::ofstream(str) : &std::cout); |
44 |
if(str) { |
static bool setbufyet = false; |
45 |
|
if(!setbufyet && str) { |
46 |
dbgstream->rdbuf()->pubsetbuf(0,0); |
dbgstream->rdbuf()->pubsetbuf(0,0); |
47 |
|
setbufyet = true; |
48 |
} |
} |
49 |
return &std::cout; |
return &std::cout; |
50 |
} |
} |