35 #define QwOut gQwLog(QwLog::kAlways,__PRETTY_FUNCTION__)
40 #define QwError gQwLog(QwLog::kError,__PRETTY_FUNCTION__)
45 #define QwWarning gQwLog(QwLog::kWarning,__PRETTY_FUNCTION__)
50 #define QwMessage gQwLog(QwLog::kMessage,__PRETTY_FUNCTION__)
55 #define QwVerbose gQwLog(QwLog::kVerbose,__PRETTY_FUNCTION__)
60 #define QwDebug gQwLog(QwLog::kDebug,__PRETTY_FUNCTION__)
78 class QwLog :
public std::ostream {
120 void InitLogFile(
const std::string name,
const std::ios_base::openmode mode =
kAppend);
137 const std::string func_sig =
"<unknown>");
160 static std::ostream&
endl(std::ostream&);
164 static std::ostream&
flush(std::ostream&);
void InitLogFile(const std::string name, const std::ios_base::openmode mode=kAppend)
Initialize the log file with name 'name'.
std::vector< std::string > fDebugFunctionRegexString
QwLogLevel fFileThreshold
File thresholds and stream.
static bool fScreenAtNewLine
void SetScreenThreshold(int thr)
Set the screen log level.
static bool fFileAtNewLine
Flags only relevant for current line, but static for use in static function.
QwLogLevel fScreenThreshold
Screen thresholds and stream.
static const std::ios_base::openmode kAppend
void ProcessOptions(QwOptions *options)
Process class options for QwOptions.
QwLog & operator<<(const T &t)
Stream an object to the output stream.
static const std::ios_base::openmode kTruncate
Log file open modes.
void SetScreenColor(bool flag)
Set the screen color mode.
const char * GetTime()
Get the local time.
void SetFileThreshold(int thr)
Set the file log level.
virtual ~QwLog()
The destructor.
std::map< std::string, bool > fIsDebugFunction
List of regular expressions for functions that will have increased log level.
bool fPrintFunctionSignature
Flag to print function signature on warning or error.
static void DefineOptions(QwOptions *options)
Define available class options for QwOptions.
QwLogLevel fLogLevel
Log level of this stream.
static const double T
Magnetic field: base unit is T.
QwLog & operator()(const QwLogLevel level, const std::string func_sig="<unknown>")
Set the stream log level.
bool fUseColor
Flag to disable color.
static bool fScreenInColor
static std::ostream & endl(std::ostream &)
End of the line.
bool IsDebugFunction(const string func_name)
Determine whether the function name matches a specified list of regular expressions.
static std::ostream & flush(std::ostream &)
Flush the streams.