T-EMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Logging.h
Go to the documentation of this file.
1 //===-- temu-c/Logging.h - Logging functions --------------------*- C++ -*-===//
2 //
3 // T-EMU: The Terma Emulator
4 // (c) Terma 2015
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef TEMU_LOGGING_H
10 #define TEMU_LOGGING_H
11 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 
59 typedef enum temu_LogLevel {
60  teLL_Fatal = 0,
67 
74 void temu_logSetLevel(temu_LogLevel LogLevel);
75 
89 void temu_logSetFunc(void (*LogFunc)(const char *));
90 
91 void temu_logFatal(const void *Obj, const char *Msg, ...)
92  __attribute__((noreturn))
93  __attribute__((format(printf, 2, 3)));
94 
95 void temu_logCritical(const void *Obj, const char *Msg, ...)
96  __attribute__((noreturn))
97  __attribute__((format(printf, 2, 3)))
98  __attribute__((deprecated));
99 
100 void temu_logError(const void *Obj, const char *Msg, ...)
101  __attribute__((format(printf, 2, 3)));
102 
103 void temu_logWarning(const void *Obj, const char *Msg, ...)
104  __attribute__((format(printf, 2, 3)));
105 
106 void temu_logInfo(const void *Obj, const char *Msg, ...)
107  __attribute__((format(printf, 2, 3)));
108 
109 void temu_logDebugFunc(const void *Obj, const char *Msg, ...)
110  __attribute__((format(printf, 2, 3)));
111 
112 #if NDEBUG
113 static inline void
114 temu_logDebug(const void *Obj, const char *Msg, ...)
115 {
116  ; // Nothing
117 }
118 
119 #else
120 
121 void temu_logDebug(const void *Obj, const char *Msg, ...)
122  __attribute__((format(printf, 2, 3)));
123 
124 #endif
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* ! TEMU_LOGGING_H */
Debug.
Definition: Logging.h:65
Fatal, emulator cannot keep on running.
Definition: Logging.h:60
Normal messages.
Definition: Logging.h:64
void temu_logError(const void *Obj, const char *Msg,...) __attribute__((format(printf
void temu_logSetFunc(void(*LogFunc)(const char *))
void void temu_logCritical(const void *Obj, const char *Msg,...) __attribute__((noreturn)) __attribute__((format(printf
Warnings.
Definition: Logging.h:63
void void __attribute__((deprecated))
void temu_logFatal(const void *Obj, const char *Msg,...) __attribute__((noreturn)) __attribute__((format(printf
Error happened, in principle critical but up to user.
Definition: Logging.h:62
void void void void temu_logDebugFunc(const void *Obj, const char *Msg,...) __attribute__((format(printf
temu_LogLevel
Definition: Logging.h:59
void temu_logSetLevel(temu_LogLevel LogLevel)
void void void temu_logInfo(const void *Obj, const char *Msg,...) __attribute__((format(printf
void void void void void temu_logDebug(const void *Obj, const char *Msg,...) __attribute__((format(printf
Critical, emulator cannot keep on running.
Definition: Logging.h:61
void void temu_logWarning(const void *Obj, const char *Msg,...) __attribute__((format(printf