Skip to content

Commit ee475a4

Browse files
committed
contrib: sync csnippets
Signed-off-by: He Xian <hexian000@outlook.com>
1 parent c5c3fd7 commit ee475a4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

contrib/csnippets/utils/slog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef void (*slog_writer_fn)(
2727
struct slog_extra *extra, const char *format, va_list args);
2828

2929
static const unsigned char slog_level_char[] = {
30-
'-', 'F', 'E', 'W', 'I', 'I', 'D', 'V', 'V',
30+
'T', 'F', 'E', 'W', 'I', 'I', 'D', 'V', 'V',
3131
};
3232

3333
FILE *slog_output;

contrib/csnippets/utils/slog.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ void slog_write(
6464
#define LOGLEVEL(level) ((LOG_LEVEL_##level) <= slog_level_)
6565
#endif
6666

67+
/* Temporary: Temporary logs are printed in any debug build regardless of log level. */
68+
#ifndef NDEBUG
69+
#define LOGT_F(format, ...) \
70+
do { \
71+
LOG_F(SILENCE, format, __VA_ARGS__); \
72+
} while (0)
73+
#else
74+
#define LOGT_F(format, ...) \
75+
do { \
76+
} while (0)
77+
#endif
78+
#define LOGT(message) LOGT_F("%s", message)
79+
6780
/* Fatal: Serious problems that are likely to cause the program to exit. */
6881
#define LOGF_F(format, ...) \
6982
do { \

0 commit comments

Comments
 (0)