Debian Codegraph @

src/io/log.h

raw symbols SCIP
1
2 /**
3 *
4 * @file log.h
5 *
6 * Part of the OpenJazz project
7 *
8 * @par Licence:
9 * Copyright (c) 2015-2026 Carsten Teibes
10 *
11 * OpenJazz is distributed under the terms of
12 * the GNU General Public License, version 2.0
13 *
14 */
15
16 #ifndef OJ_LOG_H
17 #define OJ_LOG_Hcxx . . $ `src/io/log.h:17:9`!
18
19 #include "OpenJazz.h"cxx . . $ `<file>/src/OpenJazz.h`/
20 #include <cstdio>
21
22 // Loglevels
23 enumcxx . . $ $anonymous_type_5690b115c691aebf_0# {
24 LL_MAXcxx . . $ LL_MAX.,
25 LL_TRACEcxx . . $ LL_TRACE.,
26 LL_DEBUGcxx . . $ LL_DEBUG.,
27 LL_INFOcxx . . $ LL_INFO.,
28 LL_WARNcxx . . $ LL_WARN.,
29 LL_ERRORcxx . . $ LL_ERROR.,
30 LL_FATALcxx . . $ LL_FATAL.
31 };
32
33 /* Let the compiler help with parameter formats
34 * (arguments are shifted by 1, because of hidden "this" pointer)
35 */
36 #ifdef __GNUG__cxx . . $ `<built-in>:12:9`!
37 #define LIKE_PRINTFcxx . . $ `src/io/log.h:37:10`! __attribute__((format(printf, 5, 6)))
38 #else
39 #define LIKE_PRINTF
40 #endif
41
42 // Class
43
44 /// Configuration
45 class Logcxx . . $ Log# {
46
47 public:
48 Logcxx . . $ Log#Log(49f6e7a06ebc5aa8).();
49 ~cxx . . $ Log#`~Log`(49f6e7a06ebc5aa8).Logcxx . . $ Log#();
50
51 void setLevelcxx . . $ Log#setLevel(d4f767463ce0a6b3).(int level);
52 int getLevelcxx . . $ Log#getLevel(b126dc7c1de90089).();
53 void setQuietcxx . . $ Log#setQuiet(b45ddcbc8423892c).(bool enable);
54 void logcxx . . $ Log#log(cf10f40a72032897).(int level, const char *file, int line, const char *fmt, ...) LIKE_PRINTFcxx . . $ `src/io/log.h:37:10`!;
55
56 private:
57 Logcxx . . $ Log#Log(8e5a5b75144381da).(const Logcxx . . $ Log#&); // non construction-copyable
58 Logcxx . . $ Log#& operatorcxx . . $ Log#`operator=`(a33e7d8de699a9d6).=(const Logcxx . . $ Log#&); // non copyable
59
60 FILE *logfilecxx . . $ Log#logfile.;
61 int levelcxx . . $ Log#level.;
62 bool quietcxx . . $ Log#quiet.;
63 bool color_stdoutcxx . . $ Log#color_stdout., color_stderrcxx . . $ Log#color_stderr.;
64
65 };
66
67 // Variable
68
69 EXTERNcxx . . $ `src/OpenJazz.h:38:10`! Logcxx . . $ Log# loggercxx . . $ logger.;
70
71 // Helper macros
72
73 #define LOG_MAXcxx . . $ `src/io/log.h:73:9`!(...) logger.log(LL_MAX, __FILE__, __LINE__, __VA_ARGS__)
74 #define LOG_TRACEcxx . . $ `src/io/log.h:74:9`!(...) logger.log(LL_TRACE, __FILE__, __LINE__, __VA_ARGS__)
75 #define LOG_DEBUGcxx . . $ `src/io/log.h:75:9`!(...) logger.log(LL_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
76 #define LOG_INFOcxx . . $ `src/io/log.h:76:9`!(...) logger.log(LL_INFO, __FILE__, __LINE__, __VA_ARGS__)
77 #define LOG_WARNcxx . . $ `src/io/log.h:77:9`!(...) logger.log(LL_WARN, __FILE__, __LINE__, __VA_ARGS__)
78 #define LOG_ERRORcxx . . $ `src/io/log.h:78:9`!(...) logger.log(LL_ERROR, __FILE__, __LINE__, __VA_ARGS__)
79 #define LOG_FATALcxx . . $ `src/io/log.h:79:9`!(...) logger.log(LL_FATAL, __FILE__, __LINE__, __VA_ARGS__)
80
81 #undef LIKE_PRINTFcxx . . $ `src/io/log.h:37:10`!
82
83 #endif