Boost C++ Libraries: Ticket #10246: asynchronous_sink sometimes "misses" an attribute https://svn.boost.org/trac10/ticket/10246 <p> Using following </p> <pre class="wiki">boost::log::sinks::asynchronous_sink&lt; boost::log::sinks::text_ostream_backend &gt; boost::log::sources::severity_channel_logger_mt&lt;Level, Group&gt; scl; </pre><p> with helper keywords (Level and Group and enums) </p> <pre class="wiki">namespace { BOOST_LOG_ATTRIBUTE_KEYWORD(level, "Severity", Level) BOOST_LOG_ATTRIBUTE_KEYWORD(group, "Channel", Group) } </pre><p> configured to use following format </p> <pre class="wiki">void formatter( blog::record_view const&amp; record, blog::formatting_ostream&amp; stream ) { stream &lt;&lt; "[" &lt;&lt; record[level] &lt;&lt; "]"; stream &lt;&lt; "[" &lt;&lt; record[group] &lt;&lt; "]"; stream &lt;&lt; " " &lt;&lt; record[expr::smessage]; } </pre><p> In the std::cout and/or in file output one of the attributes (I only noticed this happens for level) is (sometimes) missing, even though that they are always passed. Example: </p> <pre class="wiki">BOOST_LOG_CHANNEL_SEV(scl, Group::General, Level::Error) &lt;&lt; "Foo"; </pre><p> Possible outputs:<br /> [Error][General] Foo<br /> [][General] Foo </p> <p> This doesn't happen in case of synchronous sink. </p> <p> Visual Studio 2013 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10246 Trac 1.4.3 Andrey Semashev Sat, 26 Jul 2014 15:44:00 GMT <link>https://svn.boost.org/trac10/ticket/10246#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10246#comment:1</guid> <description> <p> Please, test with 1.56 RC or the current git master. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 26 Jul 2014 15:45:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10246#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10246#comment:2</guid> <description> <p> Also, if the more recent version still has the problem, I'll need a small test program to reproduce the problem. </p> </description> <category>Ticket</category> </item> <item> <author>bielecki.b@…</author> <pubDate>Sat, 26 Jul 2014 18:45:31 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/10246 https://svn.boost.org/trac10/ticket/10246 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">async_missing.cpp</span> </li> </ul> <p> Reproduction </p> Ticket bielecki.b@… Sat, 26 Jul 2014 18:46:02 GMT <link>https://svn.boost.org/trac10/ticket/10246#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10246#comment:3</guid> <description> <p> I've tested it with 1.56 - the problem remains. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sun, 27 Jul 2014 11:08:22 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10246#comment:4 https://svn.boost.org/trac10/ticket/10246#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> You have a race condition in operator&lt;&lt; for Level and Group enums. MSVC doesn't support thread-safe initialization of function-local static variables. Since these operators are called in dedicated threads of async sinks, they are called concurrently. Sometimes this results in the 'strings' arrays being uninitialized when used. </p> Ticket anonymous Sun, 27 Jul 2014 18:33:45 GMT <link>https://svn.boost.org/trac10/ticket/10246#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10246#comment:5</guid> <description> <p> Thank you (I thought that MSVC team got this one done at least). </p> </description> <category>Ticket</category> </item> </channel> </rss>