Moznost definice TRACE_ALL=1 pro vsechny ladici informace naraz

This commit is contained in:
Pavel Brychta 2024-07-29 16:14:03 +02:00
parent 8f6521f761
commit dc1c87cbf3

View File

@ -21,8 +21,10 @@
*/
#pragma once
// Vydefinujeme-li promennou TRACE_ALL=1, pak TRACEPLUS se bude vypisovat vsechny zpravy
// 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_WARNING 1 // varovani - zluta
#define TRACE_INFO 2 // informacni zprava - zelena
@ -138,9 +140,13 @@
#define TRACE_FORCEUPDATE(a) ((void) 0)
#endif
#ifndef TRACE_ALL
#define TRACE_ALL 0
#endif
#define TRACEPLUS(when, severity, ...) \
do { \
constexpr bool handle = (when != 0); \
constexpr bool handle = (when != 0) || TRACE_ALL; \
if (handle) \
TRACE(severity, __VA_ARGS__); \
} while (0)