This commit is contained in:
gabime
2014-01-27 11:44:10 +02:00
parent fa6f8b3c9a
commit 9934ea4044
11 changed files with 22 additions and 296 deletions

View File

@@ -32,7 +32,7 @@ public:
protected:
virtual void sink_it_(const std::string& msg) = 0;
std::atomic<int> _level = level::INFO;
std::atomic<int> _level{level::INFO};
};
class null_sink:public base_sink {
@@ -41,4 +41,4 @@ protected:
{}
};
}
}
}

View File

@@ -150,9 +150,10 @@ private:
static std::string _calc_filename(const std::string& basename, const std::string& extension)
{
std::ostringstream oss;
std::tm now_tm = c11log::details::os::localtime();
oss << basename << std::put_time(&now_tm, ".%Y-%m-%d.") << extension;
return oss.str();
std::tm tm = c11log::details::os::localtime();
char buf[32];
sprintf(buf, ".%Y-%m-%d.", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday);
return buf;
}
std::string _base_filename;
@@ -162,4 +163,4 @@ private:
std::mutex mutex_;
};
}
}
}