1 #ifndef messagefacility_MessageLogger_MessageLogger_h 2 #define messagefacility_MessageLogger_MessageLogger_h 11 #include <type_traits> 92 return std::forward<NeverLogger_>(*this);
99 return std::forward<NeverLogger_>(*this);
103 operator<<(
std::ostream& (*)(
std::ostream&))
105 return std::forward<NeverLogger_>(*this);
108 operator<<(
std::ios_base& (*)(
std::ios_base&))
110 return std::forward<NeverLogger_>(*this);
114 template <ELseverityLevel::ELsev_ SEV,
bool VERBATIM>
124 if (msg_ ==
nullptr) {
149 auto const lastSlash =
file.find_last_of(
'/');
150 if ((lastSlash != std::string::npos) &&
151 (lastSlash != (
file.size() - 1))) {
155 msg_ = std::move(std::make_unique<ErrorObj>(
168 return std::forward<MaybeLogger_>(*this);
178 return std::forward<MaybeLogger_>(*this);
187 return std::forward<MaybeLogger_>(*this);
191 operator<<(
std::ios_base& (*
f)(
std::ios_base&))
196 return std::forward<MaybeLogger_>(*this);
200 std::unique_ptr<ErrorObj> msg_{};
230 #define LOG_INFO(category) mf::LogInfo(category, __FILE__, __LINE__) 231 #define LOG_WARNING(category) mf::LogWarning(category, __FILE__, __LINE__) 232 #define LOG_ERROR(category) mf::LogError(category, __FILE__, __LINE__) 233 #define LOG_SYSTEM(category) mf::LogSystem(category, __FILE__, __LINE__) 237 #define LOG_VERBATIM(category) mf::LogVerbatim(category, __FILE__, __LINE__) 238 #define LOG_PRINT(category) mf::LogPrint(category, __FILE__, __LINE__) 239 #define LOG_PROBLEM(category) mf::LogProblem(category, __FILE__, __LINE__) 240 #define LOG_ABSOLUTE(category) mf::LogAbsolute(category, __FILE__, __LINE__) 242 #undef EDM_MESSAGELOGGER_SUPPRESS_LOGDEBUG 246 #if defined(NDEBUG) || defined(ML_NDEBUG) 247 #define EDM_MESSAGELOGGER_SUPPRESS_LOGDEBUG 248 #endif // NDEBUG || ML_NDEBUG 253 #undef EDM_MESSAGELOGGER_SUPPRESS_LOGDEBUG 256 #ifdef EDM_MESSAGELOGGER_SUPPRESS_LOGDEBUG 258 #define LOG_DEBUG(id) \ 260 #define LOG_TRACE(id) \ 263 #else // EDM_MESSAGELOGGER_SUPPRESS_LOGDEBUG 265 #define LOG_DEBUG(id) \ 266 mf::LogDebug { id, __FILE__, __LINE__ } 267 #define LOG_TRACE(id) \ 268 mf::LogTrace { id, __FILE__, __LINE__ } 270 #endif // EDM_MESSAGELOGGER_SUPPRESS_LOGDEBUG 272 #undef EDM_MESSAGELOGGER_SUPPRESS_LOGDEBUG MaybeLogger_(std::string const &category, std::string const &file="", int line_number=0)
std::string const & GetModuleName()
void SetIteration(std::string const &)
std::string const & GetIteration()
void EndMessageFacility()
MaybeLogger_(MaybeLogger_ &&rhs) noexcept
void SetModuleName(std::string const &)
std::string const & GetHostAddr()
void SetContextSinglet(std::string const &)
void SetHostAddr(std::string const &)
void SetHostName(std::string const &)
bool isMessageProcessingSetUp()
std::string const & GetApplicationName()
void LogErrorObj(ErrorObj *)
void SetContextIteration(std::string const &)
void StartMessageFacility(fhicl::ParameterSet const &, std::string const &applicationName="")
void SetApplicationName(std::string const &)
std::string const & GetHostName()