diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-08-10 01:28:20 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-08-10 01:28:20 +0900 |
| commit | 37016c65875986a098d4ad6ca9f138064932b137 (patch) | |
| tree | 2193af7e0b22c37bc4681bda52070199d62be0bb /src/Logger.cc | |
| parent | e8e3a6f259ab74c486aec9b5ea95d3e1f5068f6c (diff) | |
global cout and cerr is now retrieved using global::cout() and global::cerr()
This is necessary to avoid global variable initialization order
problem.
Diffstat (limited to 'src/Logger.cc')
| -rw-r--r-- | src/Logger.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Logger.cc b/src/Logger.cc index 3f88451b..d8ff5653 100644 --- a/src/Logger.cc +++ b/src/Logger.cc @@ -73,7 +73,7 @@ void Logger::openFile(const std::string& filename) { closeFile(); if(filename == DEV_STDOUT) { - fpp_ = global::cout; + fpp_ = global::cout(); } else { fpp_.reset(new BufferedFile(filename, BufferedFile::APPEND)); if(!fpp_) { @@ -170,11 +170,11 @@ void Logger::writeLog fpp_->flush(); } if(toConsole) { - global::cout->printf("\n"); - writeHeader(*global::cout, level, 0, 0); - global::cout->printf("%s\n", msg); - writeStackTrace(*global::cout, trace); - global::cout->flush(); + global::cout()->printf("\n"); + writeHeader(*global::cout(), level, 0, 0); + global::cout()->printf("%s\n", msg); + writeStackTrace(*global::cout(), trace); + global::cout()->flush(); } } |
