forked from JPETTomography/j-pet-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJPetLoggerInclude.h
64 lines (61 loc) · 2.06 KB
/
JPetLoggerInclude.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may find a copy of the License in the LICENCE file.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @file JPetLoggerInclude.h
* @brief Configuration file for the Logger class
* Three independent level of logging are defined: LEVEL_INFO, LEVEL_WARNING and LEVEL_ERROR
* Levels can be switched on/off separately, by assign the value different than 1.
* The messages can be redirected to the screen if the SCREEN_OUTPUT is 1.
* Also the whole JPetLogger can be switched off/on by setting the JPETLOGGER_ON flag to 1.
*/
#ifndef JPETLOGGER_INCLUDE_H
#define JPETLOGGER_INCLUDE_H
// current settings
// 1 - switched on
#define JPETLOGGER_ON 1
#define JPET_LOGGER_LEVEL_INFO 1
#define JPET_LOGGER_LEVEL_WARNING 1
#define JPET_LOGGER_LEVEL_ERROR 1
#define JPET_LOGGER_LEVEL_DEBUG 0
#define JPET_SCREEN_OUTPUT 0
// don't touch this part
#if JPETLOGGER_ON == 1
#include "./JPetLogger/JPetLogger.h"
#define DATE_AND_TIME() JPetLogger::dateAndTime()
#if JPET_LOGGER_LEVEL_INFO == 1
#define INFO(X) JPetLogger::info(__func__, X)
#else
#define INFO(X)
#endif
#if JPET_LOGGER_LEVEL_WARNING == 1
#define WARNING(X) JPetLogger::warning(__func__, X)
#else
#define WARNING(X)
#endif
#if JPET_LOGGER_LEVEL_ERROR == 1
#define ERROR(X) JPetLogger::error(__func__, X)
#else
#define ERROR(X)
#endif
#if JPET_LOGGER_LEVEL_DEBUG == 1
#define DEBUG(X) JPetLogger::debug(__func__, X)
#else
#define DEBUG(X)
#endif
#else
#define WARNING(X)
#define ERROR(X)
#define INFO(X)
#define DEBUG(X)
#define DATE_AND_TIME()
#endif
#endif