|
|
@@ -49,12 +49,12 @@ bool logger::init(std::string strLogPath, std::string strLogName) {
|
|
|
boost::make_shared<logging::sinks::text_multifile_backend>();
|
|
|
// Set up the file naming pattern
|
|
|
backend->set_file_name_composer(logging::sinks::file::as_file_name_composer(
|
|
|
- logexpr::stream << strLogPath
|
|
|
- << "/" << strLogName << "."
|
|
|
+ logexpr::stream << strLogPath
|
|
|
+ << "/" << logexpr::format_date_time<boost::posix_time::ptime>("TimeStamp", "%Y%m%d") << "_"
|
|
|
// 文件名还是带上Level,否者copy到一起的时候分不清
|
|
|
- << logexpr::attr<logging::trivial::severity_level>("Severity") << "."
|
|
|
- << logexpr::attr<std::string>("RotationDate") << ".log"));
|
|
|
-
|
|
|
+ << logexpr::attr<logging::trivial::severity_level>("Severity") << "_"
|
|
|
+ << strLogName << ".log"));
|
|
|
+
|
|
|
sink = boost::shared_ptr<sink_t>(new sink_t(backend));
|
|
|
// Set the formatter
|
|
|
sink->set_formatter(logexpr::stream
|