/* */ #ifndef _D_LOG_FACTORY_H_ #define _D_LOG_FACTORY_H_ #include "common.h" #include namespace aria2 { class Logger; class LogFactory { private: static std::string filename; static Logger* logger; static bool _consoleOutput; public: /** * Get logger instance. Returned logger is singleton. * This function is not thread-safe. */ static Logger* getInstance(); /** * Set a filename to write log. */ static void setLogFile(const std::string& name) { filename = name; } /** * Set flag whether the log is printed in console. * If f is false, log is not printed in console. */ static void setConsoleOutput(bool f) { _consoleOutput = f; } /** * Releases used resources */ static void release(); }; } // namespace aria2 #endif // _D_LOG_FACTORY_H_