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