Boost logo

Boost Users :

Subject: [Boost-users] [log] Why aren't logger operations const ?
From: Mauricio Carneiro (carneiro_at_[hidden])
Date: 2013-11-24 02:48:58


I am trying to use a severity channel logger but I hit the problem with
BOOST_LOG_SEV not being a const method -- I'm thinking because of both
open_record() and push_record()

This will basically force me to make all methods in my classes not const
because they want to write out to their loggers. I can't really afford to
do that -- so I'm restricted to global loggers at the moment.

In my current implementation, each class has a logger with the class name
as the channel (initialized in their constructors), and it issues log
messages at any point with BOOST_LOG_SEV(this->logger, level)

I'd love to hear the reason behind the non-constness and if my design is
not the intended for Boost::Log.

Thank you for your help.

Mauricio Carneiro, Ph.D.
http://www.broadinstitute.org/~carneiro/



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