Kernel Quantum Probability Library
The KQP library aims at providing tools for working with quantums probabilities
define_header_logger.hpp
1 /*
2  This file is part of the Kernel Quantum Probability library (KQP).
3 
4  KQP is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  KQP is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with KQP. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 
19 #include <boost/preprocessor/cat.hpp>
20 
21 #include <kqp/kqp.hpp>
22 
23 
24 # ifndef KQP_HLOGGER
25 
26 # define KQP_HLOGGER_N 1
27 
28 # // Defines helper macros
29 
30 # define KQP_HLOG_DEBUG(MESSAGE) KQP_LOG_DEBUG(KQP_HLOGGER, MESSAGE)
31 # define KQP_HLOG_INFO(MESSAGE) KQP_LOG_INFO(KQP_HLOGGER, MESSAGE)
32 # define KQP_HLOG_WARN(MESSAGE) KQP_LOG_WARN(KQP_HLOGGER, MESSAGE)
33 # define KQP_HLOG_ERROR(MESSAGE) KQP_LOG_ERROR(KQP_HLOGGER, MESSAGE)
34 # define KQP_HLOG_ASSERT(CONDITION, MESSAGE) KQP_LOG_ASSERT(KQP_HLOGGER, CONDITION, MESSAGE)
35 
36 # define KQP_HLOG_DEBUG_F(FORMAT, OBJS) KQP_LOG_DEBUG_F(KQP_HLOGGER, FORMAT, OBJS)
37 # define KQP_HLOG_INFO_F(FORMAT, OBJS) KQP_LOG_INFO_F(KQP_HLOGGER, FORMAT, OBJS)
38 # define KQP_HLOG_WARN_F(FORMAT, OBJS) KQP_LOG_WARN_F(KQP_HLOGGER, FORMAT, OBJS)
39 # define KQP_HLOG_ERROR_F(FORMAT, OBJS) KQP_LOG_ERROR_F(KQP_HLOGGER, FORMAT, OBJS)
40 # define KQP_HLOG_ASSERT_F(CONDITION, FORMAT, OBJS) KQP_LOG_ASSERT_F(KQP_HLOGGER, CONDITION, FORMAT, OBJS)
41 
42 # else
43 # undef KQP_HLOGGER
44 # undef DEFINE_KQP_HLOGGER
45 # if (KQP_HLOGGER_N == 1)
46 # undef KQP_HLOGGER_N
47 # define KQP_HLOGGER_N 2
48 # elif (KQP_HLOGGER_N == 2)
49 # undef KQP_HLOGGER_N
50 # define KQP_HLOGGER_N 3
51 # elif (KQP_HLOGGER_N == 3)
52 # undef KQP_HLOGGER_N
53 # define KQP_HLOGGER_N 4
54 # elif (KQP_HLOGGER_N == 4)
55 # undef KQP_HLOGGER_N
56 # define KQP_HLOGGER_N 5
57 # elif (KQP_HLOGGER_N == 5)
58 # undef KQP_HLOGGER_N
59 # define KQP_HLOGGER_N 6
60 # elif (KQP_HLOGGER_N == 6)
61 # undef KQP_HLOGGER_N
62 # define KQP_HLOGGER_N 7
63 # elif (KQP_HLOGGER_N == 7)
64 # undef KQP_HLOGGER_N
65 # define KQP_HLOGGER_N 8
66 # elif (KQP_HLOGGER_N == 8)
67 # undef KQP_HLOGGER_N
68 # define KQP_HLOGGER_N 9
69 # elif (KQP_HLOGGER_N == 9)
70 # undef KQP_HLOGGER_N
71 # define KQP_HLOGGER_N 10
72 # elif (KQP_HLOGGER_N == 10)
73 # undef KQP_HLOGGER_N
74 # define KQP_HLOGGER_N 11
75 # elif (KQP_HLOGGER_N == 11)
76 # undef KQP_HLOGGER_N
77 # define KQP_HLOGGER_N 12
78 # else
79 # error "No more header loggers available"
80 # endif
81 # endif
82 
83 # // New KQP Header logger
84 # define KQP_HLOGGER BOOST_PP_CAT(KQP_HEADER_LOGGER_, KQP_HLOGGER_N)
85 
86 # // New definition
87 # define DEFINE_KQP_HLOGGER(NAME) DEFINE_LOGGER(KQP_HLOGGER, NAME)
88