0
我有一些問題,Boost.Log:這是一個snipet: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
似乎格式不對工作......我是否錯了?
你的問題在某種程度上似乎不完全 – PlasmaHH
我編輯問題 –
通常在諸如「followig輸出」之類的詞之後,人們期望的是,輸出。 – PlasmaHH