diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-22 01:10:38 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-22 01:10:38 +0900 |
| commit | 07d270c87e6f9184aea4ca17eb26e466712e8db2 (patch) | |
| tree | 2dfbaa2e0d2ad0f38cb73098608f7d67a64320f8 /src/LogFactory.h | |
| parent | 126a4bde612eb0e6c48cf2f13ebe3eac45cc71a8 (diff) | |
Require -std=c++11 and use std::shared_ptr instead of SharedHandle
Diffstat (limited to 'src/LogFactory.h')
| -rw-r--r-- | src/LogFactory.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/LogFactory.h b/src/LogFactory.h index b80aadd8..d28b115f 100644 --- a/src/LogFactory.h +++ b/src/LogFactory.h @@ -38,21 +38,21 @@ #include "common.h" #include <string> +#include <memory> #include "Logger.h" -#include "SharedHandle.h" namespace aria2 { class LogFactory { private: static std::string filename_; - static SharedHandle<Logger> logger_; + static std::shared_ptr<Logger> logger_; static bool consoleOutput_; static Logger::LEVEL logLevel_; static Logger::LEVEL consoleLogLevel_; - static void openLogger(const SharedHandle<Logger>& logger); + static void openLogger(const std::shared_ptr<Logger>& logger); LogFactory(); public: @@ -60,7 +60,7 @@ public: * Get logger instance. Returned logger is singleton. * This function is not thread-safe. */ - static const SharedHandle<Logger>& getInstance(); + static const std::shared_ptr<Logger>& getInstance(); /** * Set a filename to write log. If name is "-", log is written to @@ -112,14 +112,14 @@ public: #define A2_LOG(level, msg) \ { \ - const aria2::SharedHandle<aria2::Logger>& logger = \ + const std::shared_ptr<aria2::Logger>& logger = \ aria2::LogFactory::getInstance(); \ if(logger->levelEnabled(level)) \ logger->log(level, __FILE__, __LINE__, msg); \ } #define A2_LOG_EX(level, msg, ex) \ { \ - const aria2::SharedHandle<aria2::Logger>& logger = \ + const std::shared_ptr<aria2::Logger>& logger = \ aria2::LogFactory::getInstance(); \ if(logger->levelEnabled(level)) \ logger->log(level, __FILE__, __LINE__, msg, ex); \ |
