blob: 8f0e9249ba964127ec395484d597ff58de2d2f7a [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
10#ifndef CPUINFO_LOG_LEVEL
11 #define CPUINFO_LOG_LEVEL CPUINFO_LOG_ERROR
12#endif
13
14#ifdef __GNUC__
15__attribute__((__format__(__printf__, 1, 2)))
16#endif
17#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_DEBUG
18 void cpuinfo_log_debug(const char* format, ...);
19#else
20 static inline void cpuinfo_log_debug(const char* format, ...) { }
21#endif
22
23#ifdef __GNUC__
24__attribute__((__format__(__printf__, 1, 2)))
25#endif
26#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_INFO
27 void cpuinfo_log_info(const char* format, ...);
28#else
29 static inline void cpuinfo_log_info(const char* format, ...) { }
30#endif
31
32#ifdef __GNUC__
33__attribute__((__format__(__printf__, 1, 2)))
34#endif
35#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_WARNING
36 void cpuinfo_log_warning(const char* format, ...);
37#else
38 static inline void cpuinfo_log_warning(const char* format, ...) { }
39#endif
40
41#ifdef __GNUC__
42__attribute__((__format__(__printf__, 1, 2)))
43#endif
44#if CPUINFO_LOG_LEVEL >= CPUINFO_LOG_ERROR
45 void cpuinfo_log_error(const char* format, ...);
46#else
47 static inline void cpuinfo_log_error(const char* format, ...) { }
48#endif