2
一般來說,如何在boost日誌格式表達式上執行字符串操作?特別是,我該如何截斷以小數秒結尾的TimeStamp表達式,以便記錄毫秒而不是微秒?如何截斷boost日誌格式表達式
鑑於此片段,我如何記錄,例如,13:13:08.440而不是13:13:08.440736?
logging::add_file_log("xyz.log",
keywords::format = expr::stream
<< expr::format_date_time<boost::posix_time::ptime>("TimeStamp", "%T.%f")
);
我想要做這樣的事情:
<< expr::format_date_time<boost::posix_time::ptime>("TimeStamp", "%T.%.3f")
你有沒有想過這個?我在同一條船上。 – Kurt 2015-03-20 05:40:20
沒有。我只活了幾微秒。 – plong 2015-03-23 14:26:26