4 #include <boost/shared_ptr.hpp> 19 {
write(l, std::string(v)); }
25 virtual std::ostream*
stream() = 0;
33 void print(std::ostream& Os) {Os <<
"LogImp";}
35 std::ostringstream
os;
78 { instance().imp_ = imp; }
87 { instance().imp_.reset(imp); }
96 return instance().imp_->stream();
105 static Logger& instance();
113 void print(std::ostream& Os) {Os <<
"Logger";}
void write(log_level l, const T &v)
virtual std::ostream * stream()=0
Underlying stream, can be null if no underlying stream.
virtual void flush(log_level l)=0
Flush data to the log, at the given level.
void print(std::ostream &Os)
static void set_implementation(LogImp *imp)
Set the implementation.
void write(log_level l, const char *v)
This is a Mixin for classes that can be printed.
The actual implementation of the Logger.
static std::ostream * stream()
Underlying stream, can be null if no underlying stream.
LogHelper(LogImp::log_level l, boost::shared_ptr< LogImp > &imp)
LogHelper & operator<<(T v)
void print(std::ostream &Os)
Contains classes to abstract away details in various Spurr Radiative Transfer software.
static LogHelper log(LogImp::log_level l)
This is a class that holds the level we are logging.
static LogHelper warning()
static void set_implementation(const boost::shared_ptr< LogImp > &imp)
Set the implementation.