12#ifndef RDLOG_H_29JUNE2005
13#define RDLOG_H_29JUNE2005
17#include <boost/iostreams/tee.hpp>
18#include <boost/iostreams/stream.hpp>
28typedef boost::iostreams::tee_device<std::ostream, std::ostream>
RDTee;
41 rdLogger(std::ostream *dest,
bool owner =
false)
45 dp_teeHelperStream(nullptr),
53 tee =
new RDTee(*dp_dest, stream);
61 auto s =
new std::ofstream(filename);
63 dp_teeHelperStream = s;
68 void SetTee(
const std::string &filename) {
return SetTee(filename.c_str()); }
77 if (dp_teeHelperStream) {
78 dp_teeHelperStream->close();
79 delete dp_teeHelperStream;
80 dp_teeHelperStream =
nullptr;
110#define BOOST_LOG(__arg__) \
111 if ((__arg__) && (__arg__->dp_dest) && (__arg__->df_enabled)) \
112 RDLog::toStream((__arg__->teestream) ? *(__arg__->teestream) \
113 : *(__arg__->dp_dest))
115using RDLogger = std::shared_ptr<boost::logging::rdLogger>;
125#define BOOST_LOG_NO_LIB
126#include <boost/log/log.hpp>
137using RDLoggerList = std::vector<RDLogger>;
142 LogStateSetter(RDLoggerList toEnable);
149 std::uint64_t d_origState = 0;
152inline void deprecationWarning(
const std::string &message) {
std::shared_ptr< boost::logging::rdLogger > RDLogger
RDKIT_RDGENERAL_EXPORT RDLogger rdDebugLog
RDKIT_RDGENERAL_EXPORT RDLogger rdStatusLog
#define BOOST_LOG(__arg__)
RDKIT_RDGENERAL_EXPORT RDLogger rdAppLog
RDKIT_RDGENERAL_EXPORT RDLogger rdInfoLog
RDKIT_RDGENERAL_EXPORT RDLogger rdWarningLog
RDKIT_RDGENERAL_EXPORT RDLogger rdErrorLog
std::ofstream * dp_teeHelperStream
void SetTee(const char *filename)
Sets a filename to tee the output to.
rdLogger(std::ostream *dest, bool owner=false)
void ClearTee()
Remove our tee if it's set.
void SetTee(std::ostream &stream)
Sets a stream to tee the output to.
void SetTee(const std::string &filename)
Sets a filename to tee the output to.
#define RDKIT_RDGENERAL_EXPORT
RDKIT_RDGENERAL_EXPORT std::string log_status()
RDKIT_RDGENERAL_EXPORT void enable_logs(const char *arg)
boost::iostreams::tee_device< std::ostream, std::ostream > RDTee
RDKIT_RDGENERAL_EXPORT void disable_logs(const char *arg)
boost::iostreams::stream< RDTee > RDTeeStream