Loading [MathJax]/extensions/tex2jax.js
ROOT
6.12/07
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace 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
l
m
n
o
p
q
r
s
u
w
x
+
Enumerations
a
e
f
g
m
p
t
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
w
+
All Classes
Class List
Class Index
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
k
l
m
n
o
p
r
s
t
u
v
w
x
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
w
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Properties
f
+
Related 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
z
+
Files
File List
+
File Members
+
All
1
2
3
4
5
6
7
8
9
_
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
+
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
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
c
e
f
i
l
m
p
r
u
x
+
Enumerator
a
c
d
e
f
g
h
i
k
l
n
o
p
r
s
v
w
+
Macros
1
2
3
4
5
6
7
8
9
_
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
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
core
base
v7
src
TLogger.cxx
Go to the documentation of this file.
1
/// \file TLogger.cxx
2
/// \ingroup Base ROOT7
3
/// \author Axel Naumann <axel@cern.ch>
4
/// \date 2015-07-07
5
/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6
/// is welcome!
7
8
/*************************************************************************
9
* Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
10
* All rights reserved. *
11
* *
12
* For the licensing terms see $ROOTSYS/LICENSE. *
13
* For the list of contributors see $ROOTSYS/README/CREDITS. *
14
*************************************************************************/
15
16
#include "
ROOT/TLogger.hxx
"
17
#include <iostream>
18
19
// pin vtable
20
ROOT::Experimental::TLogHandler::~TLogHandler
() {}
21
22
namespace
{
23
class
TLogHandlerDefault:
public
ROOT::Experimental::TLogHandler
{
24
public
:
25
// Returns false if further emission of this log entry should be suppressed.
26
bool
Emit
(
const
ROOT::Experimental::TLogEntry
&entry)
override
;
27
};
28
29
bool
TLogHandlerDefault::Emit(
const
ROOT::Experimental::TLogEntry
&entry)
30
{
31
constexpr
static
std::array<const char *, 5> sTag{{
"Debug"
,
"Info"
,
"Warning"
,
"Log"
,
"FATAL"
}};
32
std::cerr <<
"ROOT "
;
33
if
(!entry.
fGroup
.empty())
34
std::cerr <<
'['
<< entry.
fGroup
<<
"] "
;
35
std::cerr << sTag[static_cast<int>(entry.
fLevel
)];
36
37
if
(!entry.
fFile
.empty())
38
std::cerr <<
" "
<< entry.
fFile
<<
':'
<< entry.
fLine
;
39
if (!entry.
fFuncName
.empty())
40
std::cerr <<
" in "
<< entry.
fFuncName
;
41
std::cerr <<
":\n"
42
<<
" "
<< entry.str() <<
'\n'
;
43
return
true
;
44
}
45
}
// unnamed namespace
46
47
ROOT::Experimental::TLogManager
&
ROOT::Experimental::TLogManager::Get
()
48
{
49
static
TLogManager
instance(std::make_unique<TLogHandlerDefault>());
50
return
instance;
51
}
ROOT::Experimental::TLogEntry::fFuncName
std::string fFuncName
Definition:
TLogger.hxx:83
ROOT::Experimental::TLogHandler::Emit
virtual bool Emit(const TLogEntry &entry)=0
ROOT::Experimental::TLogHandler::~TLogHandler
virtual ~TLogHandler()
Definition:
TLogger.cxx:20
ROOT::Experimental::TLogEntry::fFile
std::string fFile
Definition:
TLogger.hxx:82
TLogger.hxx
ROOT::Experimental::TLogManager
Definition:
TLogger.hxx:52
ROOT::Experimental::TLogEntry
Definition:
TLogger.hxx:79
ROOT::Experimental::TLogManager::Get
static TLogManager & Get()
Definition:
TLogger.cxx:47
ROOT::Experimental::TLogEntry::fLine
int fLine
Definition:
TLogger.hxx:84
ROOT::Experimental::TLogHandler
Abstract TLogHandler base class.
Definition:
TLogger.hxx:45
ROOT::Experimental::TLogEntry::fLevel
ELogLevel fLevel
Definition:
TLogger.hxx:85
ROOT::Experimental::TLogEntry::fGroup
std::string fGroup
Definition:
TLogger.hxx:81