18 #endif //HAVE_CONFIG_H
32 void write(
const char *fmt, va_list ap);
39 static Logger* instance();
45 void Logger::write(
const char *fmt, va_list ap) {
46 vfprintf(mStream, fmt, ap);
51 if(!inFileName.empty()) {
52 FILE *fp = fopen(inFileName.c_str(),
"w");
54 if(mStream && mStream != stdout) {
62 Logger::Logger() : mStream(stdout) {}
65 if(mStream && mStream != stdout) {
71 Logger* Logger::instance() {
84 Logger::instance()->openLogFile(logFileName);
89 void log(
const char *fmt, ...) {
93 Logger::instance()->write(fmt, args);
void log(const char *fmt,...)
void openLogFile(const std::string &logFileName)