15#include "GaudiKernel/MsgStream.h"
16#include "GaudiKernel/INamedInterface.h"
41 const std::string p = pkg.substr(0, pkg.find(
'-'));
44 std::string::size_type ipos =
file.find(
"/"+p+
"/");
45 if (ipos != std::string::npos) {
46 return file.substr(ipos+1, std::string::npos);
69 const std::string& context,
71 : MsgStream (
Athena::getMessageSvc(), context)
77 *
this <<
": code " <<
sc;
80 m_pos = stream().str().size();
99 const std::string& context)
100 : MsgStream (
Athena::getMessageSvc(), context)
106 m_pos = stream().str().size();
129 *
this <<
"FILE:LINE";
131 if (pkg && pkg[0] !=
'\0')
134 *
this <<
file <<
":" << line;
141 if (func && func[0] !=
'\0') {
178 if (
m_pos != stream().
str().size()) {
179 std::string tmp1 = stream().str();
180 std::string tmp2 = tmp1.substr(0,
m_pos);
182 tmp2.append( tmp1,
m_pos);
185 return MsgStream::doOutput();
232 return context->name();
Helpers for checking error return status codes and reporting errors.
static const Attributes_t empty
std::string::size_type m_pos
The position in the output message after the standard header.
static std::atomic< bool > s_hide_function_names
If true, hide the function names in output messages.
virtual MsgStream & doOutput() override
Emit the message.
~ReportMessage()
Destructor.
static std::atomic< bool > s_hide_error_locus
If true, hide the source file and line number in output messages.
static void hideFunctionNames(bool flag=true)
If set to true, hide function names in the output.
static void hideErrorLocus(bool flag=true)
If set to true, hide the source file and line number in the output.
ReportMessage(MSG::Level level, int line, const char *file, const char *func, const char *pkg, const std::string &context, StatusCode sc)
Constructor.
void format_common(MSG::Level level, int line, const char *file, const char *func, const char *pkg)
Generate the common header for messages.
singleton-like access to IMessageSvc via open function and helper
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
std::string normalizeFunctionName(const std::string &fname)
Normalize a pretty-printed C++ function name.
std::string munge_filename(const std::string &file, const std::string &pkg)
Shorten filename.
std::string context_name(const INamedInterface *context)
Return the context name from a context (this) pointer.
Normalize a pretty-printed C++ function name,.