SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
logging.h
Go to the documentation of this file.
1 #pragma once
2 
3 /**
4  * @file
5  * Use your own judgement for the following log levels:
6  * TRACE Finer-grained informational events than the DEBUG.
7  * DEBUG Fine-grained informational events that are most useful to debug an application.
8  * INFO Informational messages that highlight the progress of the application at coarse-grained level.
9  * WARN Potentially harmful situations.
10  * ERROR Error events that might still allow the application to continue running.
11  * FATAL Severe error events that will presumably lead the application to abort.
12  */
13 
14 #include "config.h"
15 
16 #if defined LOGGING
17  #define SMTRAT_LOGGING_ENABLED
18  #include <carl-logging/logging.h>
19  #define SMTRAT_LOG_FATAL(channel, msg) __CARL_LOG_FATAL(channel, msg)
20  #define SMTRAT_LOG_ERROR(channel, msg) __CARL_LOG_ERROR(channel, msg)
21  #define SMTRAT_LOG_WARN(channel, msg) __CARL_LOG_WARN(channel, msg)
22  #define SMTRAT_LOG_INFO(channel, msg) __CARL_LOG_INFO(channel, msg)
23  #define SMTRAT_LOG_DEBUG(channel, msg) __CARL_LOG_DEBUG(channel, msg)
24  #define SMTRAT_LOG_TRACE(channel, msg) __CARL_LOG_TRACE(channel, msg)
25 
26  #define SMTRAT_LOG_FUNC(channel, args) __CARL_LOG_FUNC(channel, args)
27  #define SMTRAT_LOG_ASSERT(channel, condition, msg) __CARL_LOG_ASSERT(channel, condition, msg)
28  #define SMTRAT_LOG_NOTIMPLEMENTED() __CARL_LOG_ERROR("", "Not implemented method-stub called.")
29  #define SMTRAT_LOG_INEFFICIENT() __CARL_LOG_WARN("", "Inefficient method called.")
30 #else
31  #define SMTRAT_LOG_FATAL(channel, msg) std::cerr << "FATAL " << channel << ": " << msg << std::endl;
32  #define SMTRAT_LOG_ERROR(channel, msg) std::cerr << "ERROR " << channel << ": " << msg << std::endl;
33  #define SMTRAT_LOG_WARN(channel, msg) {}
34  #define SMTRAT_LOG_INFO(channel, msg) {}
35  #define SMTRAT_LOG_DEBUG(channel, msg) {}
36  #define SMTRAT_LOG_TRACE(channel, msg) {}
37 
38  #define SMTRAT_LOG_FUNC(channel, args)
39  #define SMTRAT_LOG_ASSERT(channel, condition, msg) assert(condition)
40  #define SMTRAT_LOG_NOTIMPLEMENTED()
41  #define SMTRAT_LOG_INEFFICIENT()
42 #endif