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

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:

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

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at