Boost logo

Boost Users :

Subject: Re: [Boost-users] [logging+unittest]
From: Witold E Wolski (wewolski_at_[hidden])
Date: 2014-09-19 03:18:35


After some more web search I did find a solution:

struct Init {
    Init() {

        boost::log::add_file_log("sample.log");

        boost::log::core::get()->set_filter
        (
            boost::log::trivial::severity >= boost::log::trivial::info
        );
    }
    ~Init() {}
};

BOOST_GLOBAL_FIXTURE(Init);

Thank you.

On 19 September 2014 09:02, Witold E Wolski <wewolski_at_[hidden]> wrote:
> Hi,
>
> I need to integrate some loggin into my unit to some extend bein
> integration tests (hardware).
>
>
> How best to call this function which sets up boost logging
>
> void init() {
>
> boost::log::add_file_log("sample.log");
>
> boost::log::core::get()->set_filter
> (
> boost::log::trivial::severity >= boost::log::trivial::info
> );
> }
>
> if I have a test Runner looking like:
>
> #define BOOST_TEST_MODULE MasterTestSuite
> #include <boost/test/unit_test.hpp>
>
> Is there a way not have to add the suites manually
>
> Thanks.
>
>
>
> --
> Witold Eryk Wolski

-- 
Witold Eryk Wolski

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