12 #ifndef ECL_STREAMS_LOG_STREAM_HPP_ 13 #define ECL_STREAMS_LOG_STREAM_HPP_ 21 #include <ecl/config/macros.hpp> 22 #include <ecl/devices/shared_file.hpp> 23 #include <ecl/exceptions/standard_exception.hpp> 24 #include <ecl/time/timestamp.hpp> 43 #define LOG(logStream,mode) \ 44 if ( !logStream.isModeEnabled(mode) ) {} \ 45 else logStream.log(mode) // << rest of stream input will fill out here 56 #define FLUSH(logStream) \ 57 if ( !logStream.isEnabled() ) {} \ 58 else { logStream.flush(); } 135 if ( !this->device().open(file_name, mode) ) {
136 error = this->device().error();
143 virtual ~LogStream() {};
157 void disableHeader();
164 void enableTimeStamp();
171 void disableTimeStamp();
180 void enableMode(
int mode,
const std::string header =
"");
187 void disableMode(
int mode);
201 bool isModeEnabled(
int mode);
214 LogStream& log(
int mode);
216 using TextStream<SharedFile>::operator<<;
221 std::map<int,std::string> modes;
#define ecl_throw(exception)
Standard ecl throw exception throw.
#define ecl_streams_PUBLIC
#define ecl_throw_decl(exception)
Standard ecl throw exception declaration.
#define LOC
Stringify the line of code you are at.
#define ecl_catch(exception)
The catch part of a try-catch macro matching ecl_throw calls.
#define ecl_try
The try part of a try-catch macro matching ecl_throw calls.