Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Log] Example tutorial_fmt_stream.cpp does not compile
From: Mario Knezović (mario.knezovic_at_[hidden])
Date: 2013-07-08 12:22:40


I am trying to change date formatting exactly in the way as described in
the tutorial, sub-section "Specialized formatters":

http://www.boost.org/doc/libs/1_54_0/libs/log/doc/html/log/tutorial/formatters.html#log.tutorial.formatters.specialized_formatters

What I want to achieve is pretty simple, change month output from the
default "Abbreviated month name" (%b):
[2013-Jul-08 10:51:00.989235]
to "Month name as a decimal 01 to 12" (%m):
[2013-07-08 10:51:00.989235]

Unfortunately this does not compile, nor does the example from which the
snipped is taken: "tutorial_fmt_stream.cpp".

The interesting part in the example source is commented out by default.
(But this was the case with other examples too.)

The part I'm interested in is in line 60 (from current Boost 1.54.0):

expr::format_date_time< boost::posix_time::ptime >("TimeStamp",
"%Y-%m-%d %H:%M:%S")

The errors I get (Win7, 64-bit, MS VC++ 2010):

error C2027: use of undefined type
"boost::log::v2s_mt_nt5::expressions::aux::date_time_formatter_generator_traits<T,CharT>"
  d:\boost\boost_1_54_0\boost\log\expressions\formatters\date_time.hpp 94

error C3861: "parse": Identifier not found.
d:\boost\boost_1_54_0\boost\log\expressions\formatters\date_time.hpp 94

I hope somebody can help or point me in the right direction.

Thank you!

Mario Knezović


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net