Boost logo

Boost :

Subject: Re: [boost] [Log] Problem with Release mode build
From: Sivaram Kannan (siva.devel_at_[hidden])
Date: 2010-08-31 00:30:11


Hi,

>Do I get it right that you built Boost.Log as
> dll?

I have a DLL application to which Boost.Log is linked with. I tried
building the boost with both options linkage=static, linkage=shared.

>
> If so, please elaborate what you mean by "not creating the lg object at
> all". Does execution reach this line? If not, then what happens before it?

Execution does reaches this line. But I could not see any instance
getting created in the Locals tab. I repeat the point that this works
well in the debug mode.

> I bet it is somehow related to the Log_Init function you call before it.

I am not very sure. Here is the function. I am calling this function
from the BOOST_LOG_DECLARE_GLOBAL_LOGGER_INIT.

void Log_Init()
{

        boost::function< void (std::wostream&, boost::log::wrecord
const&) > formatter =
        boost::log::formatters::wstream
            << boost::log::formatters::date_time<
boost::posix_time::ptime >(L"TimeStamp") << L" *"
                        << boost::log::formatters::attr< int
>(L"Severity") << L"* " << boost::log::formatters::wmessage();

        boost::shared_ptr<
                sinks::synchronous_sink<boost::log::sinks::wtext_file_backend>
> sink = boost::log::winit_log_to_file(
            keywords::file_name = L"C:\\logtst.log", // file
name pattern
        keywords::rotation_size = 1 * 1024 * 1024, // rotate
files every 1 MiB...
                keywords::open_mode = std::ios_base::app,
                keywords::severity = debug,
                keywords::auto_flush = true
      );

        sink->locked_backend()->set_formatter(formatter);

        // Register common attributes
        boost::log_mt_nt5::wadd_common_attributes();
}

What am I missing here?

Thanks,
siva.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk