1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#pragma once
#include <inttypes.h>
#define CPUINFO_LOG_ERROR 1
#define CPUINFO_LOG_WARNING 2
#define CPUINFO_LOG_INFO 3
#define CPUINFO_LOG_DEBUG 4
#define CPUINFO_LOG_DEBUG_PARSERS 0
#ifndef CPUINFO_LOG_LEVEL
#define CPUINFO_LOG_LEVEL CPUINFO_LOG_ERROR
#endif
#ifdef __GNUC__
__attribute__((__format__(__printf__, 1, 2)))
#endif
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_DEBUG
void cpuinfo_log_debug(const char* format, ...);
#else
static inline void cpuinfo_log_debug(const char* format, ...) { }
#endif
#ifdef __GNUC__
__attribute__((__format__(__printf__, 1, 2)))
#endif
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_INFO
void cpuinfo_log_info(const char* format, ...);
#else
static inline void cpuinfo_log_info(const char* format, ...) { }
#endif
#ifdef __GNUC__
__attribute__((__format__(__printf__, 1, 2)))
#endif
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_WARNING
void cpuinfo_log_warning(const char* format, ...);
#else
static inline void cpuinfo_log_warning(const char* format, ...) { }
#endif
#ifdef __GNUC__
__attribute__((__format__(__printf__, 1, 2)))
#endif
#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_ERROR
void cpuinfo_log_error(const char* format, ...);
#else
static inline void cpuinfo_log_error(const char* format, ...) { }
#endif
|