Re: [Boost-bugs] [Boost C++ Libraries] #11201: setting boost::posix_time::time_facet has no effect on boost::log sinks

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11201: setting boost::posix_time::time_facet has no effect on boost::log sinks
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-04-25 20:36:42


#11201: setting boost::posix_time::time_facet has no effect on boost::log sinks
--------------------------------------+---------------------
  Reporter: Georg Sauthoff <mail@…> | Owner: andysem
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: log
   Version: Boost Development Trunk | Severity: Problem
Resolution: invalid | Keywords:
--------------------------------------+---------------------
Changes (by andysem):

 * status: new => closed
 * resolution: => invalid

Comment:

 The locale you imbue into the sink is used by the formatter (the function
 object you pass to set_formatter). It has no effect on the log message
 formatting. In fact, the message comes to the formatter as a string
 already.

 The message text is formatted by a separate stream with its own locale.
 That stream is not publicly accessible, except though the logging macros.
 The locale it uses is the default constructed and does not contain
 Boost.DateTime facets. This is so because the message text is formatted
 only once while there can be multiple sinks with different formatters and
 different locales.

 If you want the message formatting stream to use Boost.DateTime facets you
 can add the facet to the global locale before you start using Boost.Log.
 This should typically be done somewhere in the application startup code.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11201#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC