Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
msg_control.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file msg_control.cc
1
2
#include "
msg_control.h
"
3
4
int
msg_control::xx_active
=0;
5
6
7
8
9
10
msg_control::msg_control
(
const
int
mtype,
11
const
int
source
,
12
const
int
severity,
13
const
char
* sourcecomponent)
14
{
15
msg_type
= mtype;
16
msg_source
=
source
;
17
msg_severity
= severity;
18
storedseverity
= severity;
19
msg_sourcecomponent
=
new
char
[strlen(sourcecomponent) + 1 ];
20
strcpy(
msg_sourcecomponent
,sourcecomponent);
21
}
22
23
msg_control::~msg_control
(){
24
delete
[]
msg_sourcecomponent
;
25
};
26
27
int
28
msg_control::activate
()
29
{
30
int
old =
xx_active
;
31
xx_active
= 1;
32
return
old;
33
}
34
35
int
36
msg_control::deactivate
()
37
{
38
int
old =
xx_active
;
39
xx_active
= 0;
40
return
old;
41
}
42
43
void
44
msg_control::set_sourcecomponent
(
const
char
* msgsourcecomponent)
45
{
46
47
delete
msg_sourcecomponent
;
48
msg_sourcecomponent
=
new
char
[strlen(msgsourcecomponent) + 1 ];
49
strcpy(
msg_sourcecomponent
,msgsourcecomponent);
50
51
52
}
53
54
void
55
msg_control::set_severity
(
const
int
severity)
56
{
57
storedseverity
=
msg_severity
;
58
msg_severity
= severity;
59
}
// set_severity
60
61
OSTREAM
&
operator<<
(
OSTREAM
&
os
,
msg_control
&mc)
62
{
63
if
(
msg_control::xx_active
) {
64
os <<
"<|A"
65
<<
SETW
(
MSG_TYPE_WIDTH
) << mc.
msg_type
66
<<
" |B "
67
<<
SETW
(
MSG_SOURCE_WIDTH
) << mc.
msg_source
68
<<
" |C "
69
<<
SETW
(
MSG_SEV_WIDTH
) << mc.
msg_severity
70
<<
" |G "
71
<<
SETW
(strlen(mc.
msg_sourcecomponent
)+1) << mc.
msg_sourcecomponent
72
<<
" |>"
;
73
}
74
75
return
os
;
76
}
77
online_distribution
blob
master
newbasic
msg_control.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:27
using
1.8.2 with
sPHENIX GitHub integration