Boost logo

Boost Users :

Subject: [Boost-users] How to wrap boost::log class to user?
From: Bruce (liu.bl_at_[hidden])
Date: 2016-11-14 06:21:15


Hi,
I am coding a project and I use boost::log.
I need to supply the log function to user, but I don't want the user use boost::log directly.
I want to wrap the boost::log into my class. But I still want to keep the << cascade feature.

Basically, I need to implement a MyLogger class, which support:

MyLogger(info) << bla bla bla;
MyLogger(trace) << bla bla bla;

and in the operator << function, I can use:
BOOST_LOG_SEV macro.

I don't know how to implement the operator << in MyLogger class.
Can anybody helps me, Thanks.



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