00001 #ifndef HT_LOG_H_
00002 #define HT_LOG_H_
00003
00004 #include <string>
00005
00006 namespace ht {
00007 namespace options { class Config; }
00008 namespace log {
00009 enum Priority {
00010 NOTSET,
00011 DEBUG,
00012 INFO,
00013 WARNING,
00014 ERROR,
00015 CRITICAL
00016 };
00018 class Logger {
00019 public:
00020 virtual ~Logger();
00025 virtual void log(Priority level,
00026 const char *,
00027 va_list ap) const = 0;
00031 virtual void log(Priority level,
00032 const std::string & str,
00033 ...) const;
00035 void debug(const std::string & str, ...) const;
00037 void info(const std::string & str, ...) const;
00039 void warning(const std::string & str, ...) const;
00041 void error(const std::string & str, ...) const;
00043 void critical(const std::string & str, ...) const;
00044 };
00046 void configure(const options::Config *);
00048 Logger & getLogger(const std::string & str);
00049 }
00050 }
00051 #endif