2#ifndef ROSE_Diagnostics_H
3#define ROSE_Diagnostics_H
6#include "Sawyer/Assert.h"
7#include "Sawyer/Message.h"
12#define ROSE_ASSERTION_ABORT 1
13#define ROSE_ASSERTION_EXIT 2
14#define ROSE_ASSERTION_THROW 3
300namespace Diagnostics {
364 std::ostream &stream;
368 int operator()(
const char *fmt, ...);
370 int operator()(
const char *fmt, ...) __attribute__((format(printf, 2, 3)));
394#define mprintf Rose::Diagnostics::mfprintf(mlog[Rose::Diagnostics::DEBUG])
Intermediate class for printing to C++ ostreams with a printf-like API.
Converts text to messages.
Reference-counting intrusive smart pointer.
ROSE_DLL_API Sawyer::Message::DestinationPtr destination
< Collection of related streams, e.g., 'mlog'.
ROSE_DLL_API void deregister(Facility *mlog)
Deregister a facility.
ROSE_DLL_API Sawyer::Message::Facility mlog
Diagnostic facility for the ROSE library as a whole.
ROSE_DLL_API void initAndRegister(Facility *mlog, const std::string &name)
Initialize and register a logging facility.
StreamPrintf mfprintf(std::ostream &stream)
Print to a C++ stream using a printf-like API.
ROSE_DLL_API Sawyer::Message::PrefixPtr mprefix
Default line prefix for message sinks created in ROSE.
ROSE_DLL_API bool isInitialized()
Returns true if diagnostics-related global variables have been initialized.
ROSE_DLL_API void initialize()
Initialize diagnostics-related global variables.
Facilities mfacilities
Library-provided facility group.
@ WARN
Warning messages that indicate an unusual situation from which the program was able to fully recover.
@ MARCH
Progress reports and other similar rapidly updating partial messages.
@ ERROR
Error messages that indicate an abnormal situation from which the program was able to at least partia...
@ TRACE
Detailed tracing information useful to end-users that are trying to understand program internals.
@ INFO
Informative messages.
@ FATAL
Messages that indicate an abnormal situation from which the program was unable to recover.
@ DEBUG
Messages intended to be useful primarily to the author of the code.
@ WHERE
Granular tracing information useful to end-users that are trying to understand program internals.