diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-08-07 17:06:07 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-08-07 17:06:07 +0900 |
| commit | fd5f9127cd554d711a51df458fc1e6e23d812dde (patch) | |
| tree | 1c06310c114313c01b11c53480ad43f572e6290d /src/Logger.h | |
| parent | b6b8cb005dfb37646e92c4fa9b6805266cdc4632 (diff) | |
Rewritten Logger using BufferedFile.
Diffstat (limited to 'src/Logger.h')
| -rw-r--r-- | src/Logger.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Logger.h b/src/Logger.h index 6d64e6ec..dc955247 100644 --- a/src/Logger.h +++ b/src/Logger.h @@ -38,11 +38,11 @@ #include "common.h" #include <string> -#include <fstream> namespace aria2 { class Exception; +class BufferedFile; class Logger { public: @@ -55,11 +55,21 @@ public: }; private: LEVEL logLevel_; - std::ofstream file_; + BufferedFile* fpp_; + BufferedFile* stdoutfpp_; int stdoutField_; // Don't allow copying Logger(const Logger&); Logger& operator=(const Logger&); + + void writeLog + (Logger::LEVEL level, + const char* sourceFile, + int lineNum, + const char* msg, + const std::string& trace, + bool toStream, + bool toConsole); public: Logger(); |
