1 #ifndef __OPENTREP_SVC_LOGGER_HPP
2 #define __OPENTREP_SVC_LOGGER_HPP
16 #define OPENTREP_LOG_CORE(iLevel, iToBeLogged) \
17 { std::ostringstream ostr; ostr << iToBeLogged; \
18 OPENTREP::Logger::instance().log (iLevel, __LINE__, __FILE__, ostr.str()); }
20 #define OPENTREP_LOG_CRITICAL(iToBeLogged) \
21 OPENTREP_LOG_CORE (OPENTREP::LOG::CRITICAL, iToBeLogged)
23 #define OPENTREP_LOG_ERROR(iToBeLogged) \
24 OPENTREP_LOG_CORE (OPENTREP::LOG::ERROR, iToBeLogged)
26 #define OPENTREP_LOG_NOTIFICATION(iToBeLogged) \
27 OPENTREP_LOG_CORE (OPENTREP::LOG::NOTIFICATION, iToBeLogged)
29 #define OPENTREP_LOG_WARNING(iToBeLogged) \
30 OPENTREP_LOG_CORE (OPENTREP::LOG::WARNING, iToBeLogged)
32 #define OPENTREP_LOG_DEBUG(iToBeLogged) \
33 OPENTREP_LOG_CORE (OPENTREP::LOG::DEBUG, iToBeLogged)
35 #define OPENTREP_LOG_VERBOSE(iToBeLogged) \
36 OPENTREP_LOG_CORE (OPENTREP::LOG::VERBOSE, iToBeLogged)
53 const std::string& iFileName,
const T& iToBeLogged) {
54 if (iLevel <= _level) {
55 assert (_logStream != NULL);
56 *_logStream << iFileName <<
":" << iLineNumber
57 <<
": " << iToBeLogged << std::endl;
69 std::ostream& ioLogStream);
88 std::ostream* _logStream;
95 #endif // __OPENTREP_SVC_LOGGER_HPP
void setLogParameters(const LOG::EN_LogLevel iLogLevel, std::ostream &ioLogStream)
void log(const LOG::EN_LogLevel iLevel, const int iLineNumber, const std::string &iFileName, const T &iToBeLogged)
std::ostream & getLogStream()
LOG::EN_LogLevel getLogLevel()
static Logger & instance()