summaryrefslogtreecommitdiff
path: root/src/Logger.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-08-07 17:06:07 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-08-07 17:06:07 +0900
commitfd5f9127cd554d711a51df458fc1e6e23d812dde (patch)
tree1c06310c114313c01b11c53480ad43f572e6290d /src/Logger.h
parentb6b8cb005dfb37646e92c4fa9b6805266cdc4632 (diff)
Rewritten Logger using BufferedFile.
Diffstat (limited to 'src/Logger.h')
-rw-r--r--src/Logger.h14
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();