1#ifndef wxrecordhandler_h
2#define wxrecordhandler_h
32 _outStream = &std::cout;
55 void write(
const std::string& msg)
58 *_outStream << std::flush;
82 std::ostream* _outStream;
122 std::ios_base::openmode mode = std::ios_base::trunc)
125 _file =
new std::ofstream(fname.c_str(), mode);
140 std::string fname = wxc.
get<std::string>(
"file");
144 _file =
new std::ofstream(fname.c_str());
149 std::ofstream* _file;
VALUETYPE get(const std::string &name) const
Retrieve the value associated with name.
Definition: wxcrypt.h:80
WxCryptSet extends WxCrypt by providing, in addition to name-value pairs, an set of named WxCryptSets...
Definition: wxcryptset.h:35
Class to log messages to a file.
Definition: wxlogrecordhandler.h:110
WxFileHandler()
Definition: wxlogrecordhandler.h:112
void setup(const WxCryptSet &wxc)
Setup handler from supplied cryptset.
Definition: wxlogrecordhandler.h:137
~WxFileHandler()
Definition: wxlogrecordhandler.h:129
WxFileHandler(const std::string &fname, std::ios_base::openmode mode=std::ios_base::trunc)
Create new handler to write log messages to specified file.
Definition: wxlogrecordhandler.h:121
Class to handle log messages generated by WarpX logging system.
Definition: wxlogrecordhandler.h:25
void setStream(std::ostream *stream)
Set the output stream to one specified.
Definition: wxlogrecordhandler.h:47
void setOwns(bool handlerOwns)
Set if the stream to which data is being written is owned by the handler.
Definition: wxlogrecordhandler.h:68
bool owns() const
Returns true if handler owns the stream and false otherwise.
Definition: wxlogrecordhandler.h:76
WxLogRecordHandler()
Create new handler and attach std::cout to it.
Definition: wxlogrecordhandler.h:30
void write(const std::string &msg)
Write message 'msg' to the output stream.
Definition: wxlogrecordhandler.h:55
virtual ~WxLogRecordHandler()
Definition: wxlogrecordhandler.h:35
WxObject is a base class for WarpX classes which need to go through a creation/destruction cycle with...
Definition: wxobject.h:54
Class to log messages to an open stream.
Definition: wxlogrecordhandler.h:90
WxStreamHandler()
Definition: wxlogrecordhandler.h:92
WxStreamHandler(std::ostream *stream)
Create new handler with the specified output stream.
Definition: wxlogrecordhandler.h:99