Moznost definice TRACE_ALL=1 pro vsechny ladici informace naraz
This commit is contained in:
parent
8f6521f761
commit
dc1c87cbf3
10
src/trace.h
10
src/trace.h
@ -21,8 +21,10 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// Vydefinujeme-li promennou TRACE_ALL=1, pak TRACEPLUS se bude vypisovat vsechny zpravy
|
||||||
|
|
||||||
// Definice jednotlivych typu hlaseni do trasovani
|
// Definice jednotlivych typu hlaseni do trasovani
|
||||||
#define TRACE_NONE -1 // nic
|
#define TRACE_NONE (-1) // nic
|
||||||
#define TRACE_ERROR 0 // chybova zprava = cervena
|
#define TRACE_ERROR 0 // chybova zprava = cervena
|
||||||
#define TRACE_WARNING 1 // varovani - zluta
|
#define TRACE_WARNING 1 // varovani - zluta
|
||||||
#define TRACE_INFO 2 // informacni zprava - zelena
|
#define TRACE_INFO 2 // informacni zprava - zelena
|
||||||
@ -138,9 +140,13 @@
|
|||||||
#define TRACE_FORCEUPDATE(a) ((void) 0)
|
#define TRACE_FORCEUPDATE(a) ((void) 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TRACE_ALL
|
||||||
|
#define TRACE_ALL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TRACEPLUS(when, severity, ...) \
|
#define TRACEPLUS(when, severity, ...) \
|
||||||
do { \
|
do { \
|
||||||
constexpr bool handle = (when != 0); \
|
constexpr bool handle = (when != 0) || TRACE_ALL; \
|
||||||
if (handle) \
|
if (handle) \
|
||||||
TRACE(severity, __VA_ARGS__); \
|
TRACE(severity, __VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
Loading…
Reference in New Issue
Block a user