【发布时间】:2013-12-19 16:35:16
【问题描述】:
我对 Boost.Log 有一些问题:这是一个片段:
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/expressions.hpp>
#include <boost/log/sinks/text_file_backend.hpp>
#include <boost/log/utility/setup/file.hpp>
int main()
{
namespace logging = boost::log;
namespace src = boost::log::sources;
namespace expr = boost::log::expressions;
namespace keywords = boost::log::keywords;
namespace sinks = boost::log::sinks;
logging::add_file_log (
keywords::file_name = "sample_%N.log",
keywords::rotation_size = 10 * 1024 * 1024,
keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0),
keywords::format = "%TimeStamp% [%Uptime%] (%LineID%) <%Severity%>: %Message%"
);
BOOST_LOG_TRIVIAL( trace ) << "Message";
return 0;
}
我有以下输出:
[] () <>: Message
格式好像不行……我错了吗?
【问题讨论】:
-
你的问题似乎不完整
-
我编辑了问题
-
通常在“the followig output”之类的词之后,人们期望,嗯,输出。