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
LogMethod.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 *
7
* *
8
* This software is provided "as is" without any warranty. *
9
**************************************************************************/
10
11
#include <framework/logging/LogMethod.h>
12
#include <framework/logging/LogConfig.h>
13
#include <framework/logging/LogMessage.h>
14
#include <framework/logging/LogSystem.h>
15
16
#include <utility>
17
18
using namespace
std;
19
using namespace
Belle2
;
20
21
LogMethod::LogMethod(
const
char
* package,
string
function
,
string
file,
unsigned
int
line): m_package(package),
22
m_function(std::move(function)), m_file(std::move(file)), m_line(line)
23
{
24
//Send message for entering the method
25
if
(
LogSystem::Instance
().isLevelEnabled(
LogConfig::c_Info
)) {
26
string
messageText =
"--> Entering method '"
+
m_function
+
"'"
;
27
LogSystem::Instance
().
sendMessage
(
LogMessage
(
LogConfig::c_Info
, messageText,
m_package
,
m_function
,
m_file
,
m_line
));
28
}
29
}
30
31
LogMethod::~LogMethod
()
32
{
33
//Check for uncaught exceptions
34
string
uncaughtExc;
35
if
(std::uncaught_exceptions() > 0) uncaughtExc =
"("
+ std::to_string(std::uncaught_exceptions()) +
36
" uncaught exceptions pending)"
;
37
38
//Send message for leaving the method
39
if
(
LogSystem::Instance
().isLevelEnabled(
LogConfig::c_Info
)) {
40
string
messageText =
"<-- Leaving method '"
+
m_function
+
"' "
+ uncaughtExc;
41
LogSystem::Instance
().
sendMessage
(
LogMessage
(
LogConfig::c_Info
, messageText,
m_package
,
m_function
,
m_file
,
m_line
));
42
}
43
}
Belle2::LogMethod::m_package
const char * m_package
The package name where the message was sent from.
Definition:
LogMethod.h:63
Belle2::LogMethod::~LogMethod
~LogMethod()
The LogMethod destructor.
Definition:
LogMethod.cc:31
Belle2::LogSystem::sendMessage
bool sendMessage(LogMessage &&message)
Sends a log message using the log connection object.
Definition:
LogSystem.cc:71
Belle2::LogConfig::c_Info
@ c_Info
Info: for informational messages, e.g.
Definition:
LogConfig.h:37
Belle2::LogMethod::m_file
std::string m_file
The file name where the message was sent from.
Definition:
LogMethod.h:65
Belle2::LogMethod::m_line
unsigned int m_line
The line number in the source code where the message was sent from.
Definition:
LogMethod.h:66
Belle2::LogMethod::m_function
std::string m_function
The function name where the message was sent from.
Definition:
LogMethod.h:64
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:19
Belle2::LogSystem::Instance
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition:
LogSystem.cc:33
Belle2::LogMessage
The LogMessage class.
Definition:
LogMessage.h:39
framework
logging
src
LogMethod.cc
Generated on Tue Jan 4 2022 02:56:49 for Belle II Software by
1.8.17