23#ifndef VOTCA_XTP_LOGGER_H
24#define VOTCA_XTP_LOGGER_H
40#define XTP_LOG(level, log) \
41 if (level > (log).getReportLevel()) \
114 std::ostringstream message_;
138 std::cout << message_.str() <<
" " << str() << std::flush;
164class Logger final :
public std::ostream {
227 std::time_t now_time =
228 std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
229 std::tm *timeinfo = std::localtime(&now_time);
230 os << timeinfo->tm_year + 1900 <<
"-" << timeinfo->tm_mon + 1 <<
"-"
231 << timeinfo->tm_mday <<
" " << timeinfo->tm_hour <<
":"
232 << timeinfo->tm_min <<
":" << timeinfo->tm_sec;
std::ostringstream stringStream_
void setMultithreading(bool maverick)
void setPreface(Log::Level level, std::string preface)
std::string errorPreface_
void setLogLevel(Log::Level LogLevel)
Logger is used for thread-safe output of messages.
void setPreface(Log::Level level, const std::string &preface)
void setReportLevel(Log::Level ReportLevel)
Log::Level getReportLevel() const
Logger & operator()(Log::Level LogLevel)
void setMultithreading(bool maverick)
void setCommonPreface(const std::string &preface)
friend std::ostream & operator<<(std::ostream &log_out, Logger &logger)
Logger(Log::Level ReportLevel)
Timestamp returns the current time as a string Example: cout << TimeStamp()
friend std::ostream & operator<<(std::ostream &os, const TimeStamp &)
base class for all analysis tools
static Level current_level