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