WARPXM v1.10.0
Loading...
Searching...
No Matches
wxlogstreamstrm.h
Go to the documentation of this file.
1#ifndef wxlogstreamstrm_h
2#define wxlogstreamstrm_h
3
4// WarpX lib includes
5
6// std includes
7#include <sstream>
8#include <iostream>
9
14// forward declare WxLogger class
15class WxLoggerStream;
16class WxLogger;
17
22{
23public:
24 friend class WxLogStream;
25
32 template<typename T> WxLogStreamStrm& operator<<(T val)
33 {
34 _sstrm.str("");
35 _sstrm << val;
36 this->_logIt(_sstrm);
37 return *this;
38 }
39
46 WxLogStreamStrm& operator<<(std::ostream& (*p)(std::ostream&) )
47 {
48 _sstrm.str("");
49 _sstrm << p;
50 this->_logIt(_sstrm);
51 return *this;
52 }
53
60 WxLogStreamStrm& operator<<(std::ios& (*p)(std::ios&) )
61 {
62 _sstrm.str("");
63 _sstrm << p;
64 this->_logIt(_sstrm);
65 return *this;
66 }
67
68private:
72 WxLogStreamStrm(WxLogger* log, int level);
73
78
79 std::ostringstream _sstrm;
80 WxLogger* _logger;
81 int _level;
82
83 void _logIt(const std::ostringstream& str);
84};
85
87#endif // wxlogstreamstrm_h
Provides interface to streaming iostreams to logs.
Definition: wxlogstream.h:19
Works with WxLogStream for providing streaming to logs.
Definition: wxlogstreamstrm.h:22
WxLogStreamStrm & operator<<(T val)
Output supplied value.
Definition: wxlogstreamstrm.h:32
WxLogStreamStrm & operator<<(std::ostream &(*p)(std::ostream &))
I/O for manipulators.
Definition: wxlogstreamstrm.h:46
WxLogStreamStrm & operator<<(std::ios &(*p)(std::ios &))
I/O for manipulators.
Definition: wxlogstreamstrm.h:60
Definition: wxlogger.h:109