Belle II Software
release-05-02-19
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
h
i
l
m
n
p
r
s
t
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
LogConfig.cc
1
/**************************************************************************
2
* BASF2 (Belle Analysis Framework 2) *
3
* Copyright(C) 2010 - Belle II Collaboration *
4
* *
5
* Author: The Belle II Collaboration *
6
* Contributors: Andreas Moll, Thomas Kuhr *
7
* *
8
* This software is provided "as is" without any warranty. *
9
**************************************************************************/
10
11
#include <framework/logging/LogConfig.h>
12
#include <framework/logging/Logger.h>
13
14
15
using namespace
std;
16
using namespace
Belle2
;
17
18
19
LogConfig::LogConfig(
LogConfig::ELogLevel
logLevel,
int
debugLevel) :
20
m_logLevel(logLevel),
21
m_debugLevel(debugLevel),
22
m_abortLevel(
LogConfig
::c_Fatal),
23
m_logInfo{0}
24
{}
25
26
27
void
LogConfig::setLogLevel
(
ELogLevel
logLevel)
28
{
29
if
(logLevel ==
c_Fatal
) {
30
// we want to show a warning that this is not possible but the log level
31
// might already be on error hiding the warning completely. We don't want
32
// to emit an error because this might abort processing. So force a warning
33
// message.
34
Belle2::LogSystem::Instance
().
sendMessage
(
Belle2::LogMessage
(
c_Warning
,
35
"Error messages cannot be switched off. The log level is set to ERROR instead of FATAL."
,
36
PACKAGENAME(), FUNCTIONNAME(), __FILE__, __LINE__, 0));
37
logLevel =
c_Error
;
38
}
39
if
(logLevel ==
c_Debug
)
Belle2::LogSystem::enableDebug
();
40
m_logLevel
= logLevel;
41
}
42
43
44
const
char
*
LogConfig::logLevelToString
(
LogConfig::ELogLevel
logLevelType)
45
{
46
static
const
char
* logLevelString[] = {
"DEBUG"
,
"INFO"
,
"RESULT"
,
"WARNING"
,
"ERROR"
,
"FATAL"
,
"default"
};
47
return
logLevelString[logLevelType];
48
}
Belle2::LogSystem::enableDebug
static void enableDebug()
Enable debug output.
Definition:
LogSystem.h:206
Belle2::LogConfig::c_Fatal
@ c_Fatal
Fatal: for situations were the program execution can not be continued.
Definition:
LogConfig.h:41
Belle2::LogConfig::logLevelToString
static const char * logLevelToString(ELogLevel logLevelType)
Converts a log level type to a string.
Definition:
LogConfig.cc:44
Belle2::LogConfig::setLogLevel
void setLogLevel(ELogLevel logLevel)
Configure the log level.
Definition:
LogConfig.cc:27
Belle2::LogSystem::sendMessage
bool sendMessage(LogMessage &&message)
Sends a log message using the log connection object.
Definition:
LogSystem.cc:71
Belle2::LogConfig::m_logLevel
ELogLevel m_logLevel
The log messaging level.
Definition:
LogConfig.h:135
Belle2::LogConfig::ELogLevel
ELogLevel
Definition of the supported log levels.
Definition:
LogConfig.h:36
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:19
Belle2::LogConfig::c_Error
@ c_Error
Error: for things that went wrong and have to be fixed.
Definition:
LogConfig.h:40
Belle2::LogSystem::Instance
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition:
LogSystem.cc:33
Belle2::LogConfig::c_Debug
@ c_Debug
Debug: for code development.
Definition:
LogConfig.h:36
Belle2::LogConfig::c_Warning
@ c_Warning
Warning: for potential problems that the user should pay attention to.
Definition:
LogConfig.h:39
Belle2::LogConfig
The LogConfig class.
Definition:
LogConfig.h:32
Belle2::LogMessage
The LogMessage class.
Definition:
LogMessage.h:39
framework
logging
src
LogConfig.cc
Generated on Tue Jan 4 2022 02:56:48 for Belle II Software by
1.8.17