m2etis
0.4
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
Logger.h
Go to the documentation of this file.
1
/*
2
Copyright (2016) Michael Baer, Daniel Bonrath, All rights reserved.
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
22
#ifndef __M2ETIS_UTIL_LOGGER_H__
23
#define __M2ETIS_UTIL_LOGGER_H__
24
25
26
#ifdef WITH_LOGGING
27
#define GLOG_NO_ABBREVIATED_SEVERITIES
28
#include <glog/logging.h>
29
#endif
30
31
32
#ifdef WITH_LOGGING
33
#define M2ETIS_LOG_DEBUG(module, message) {\
34
DLOG(INFO) << message;\
35
}
36
#define M2ETIS_LOG_INFO(module, message) {\
37
LOG(INFO) << message;\
38
}
39
#define M2ETIS_LOG_WARN(module, message) {\
40
LOG(WARNING) << message;\
41
}
42
#define M2ETIS_LOG_ERROR(module, message) {\
43
LOG(ERROR) << message;\
44
}
45
#define M2ETIS_LOG_FATAL(module, message) {\
46
LOG(FATAL) << message;\
47
}
48
49
#define M2ETIS_LOG_SETLEVEL(level) {\
50
m2etis::util::Logger::GetSingleton().SetLogLevel(level);\
51
}
52
#else
53
#define M2ETIS_LOG_DEBUG(module, message) {\
54
}
55
#define M2ETIS_LOG_INFO(module, message) {\
56
}
57
#define M2ETIS_LOG_WARN(module, message) {\
58
}
59
#define M2ETIS_LOG_ERROR(module, message) {\
60
}
61
#define M2ETIS_LOG_FATAL(module, message) {\
62
}
63
64
#define M2ETIS_LOG_SETLEVEL(level) {\
65
}
66
#endif
/* WITH_LOGGING */
67
68
namespace
m2etis
{
69
namespace
util {
70
namespace
log {
75
#ifdef WITH_LOGGING
76
extern
bool
loggingOn;
77
78
enum
LogLevel
{
79
LOG_INFO
= google::GLOG_INFO,
80
LOG_WARN
= google::GLOG_WARNING,
81
LOG_ERROR
= google::GLOG_ERROR,
82
LOG_FATAL
= google::GLOG_FATAL,
83
LOG_NONE
= 5
84
};
85
#else
/* WITH_LOGGING */
86
enum
LogLevel
{
87
LOG_INFO
= 0,
88
LOG_WARN
,
89
LOG_ERROR
,
90
LOG_FATAL
,
91
LOG_NONE
92
};
93
#endif
/* WITH_LOGGING */
94
95
void
initializeLogging
();
96
void
shutdownLogging
();
97
98
}
/* namespace log */
99
}
/* namespace util */
100
}
/* namespace m2etis */
101
102
#endif
/* __M2ETIS_UTIL_LOGGER_H__ */
103
m2etis::util::log::LogLevel
LogLevel
Defines values to specify severity/importance of log message.
Definition:
Logger.h:86
m2etis::util::log::shutdownLogging
void shutdownLogging()
m2etis::util::log::LOG_ERROR
Definition:
Logger.h:89
m2etis::util::log::LOG_INFO
Definition:
Logger.h:87
m2etis::util::log::LOG_NONE
Definition:
Logger.h:91
m2etis
Definition:
DetMergeConfigTest.h:20
m2etis::util::log::LOG_WARN
Definition:
Logger.h:88
m2etis::util::log::initializeLogging
void initializeLogging()
m2etis::util::log::LOG_FATAL
Definition:
Logger.h:90
Projekte
m2etis
library
include
m2etis
util
Logger.h
Generated on Mon Jan 25 2016 01:06:05 for m2etis by
1.8.9.1