1.00.26
C++ Standard Airline IT Object Library
Toggle main menu visibility
Loading...
Searching...
No Matches
BasLogParams.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
#include <iostream>
7
#include <sstream>
8
// StdAir
9
#include <
stdair/basic/BasLogParams.hpp
>
10
11
namespace
stdair
{
12
13
// //////////////////////////////////////////////////////////////////////
14
BasLogParams::BasLogParams
()
15
: _logLevel (
LOG
::
DEBUG
), _logStream (std::cout),
16
_forceMultipleInit (false) {
17
assert (
false
);
18
}
19
20
// //////////////////////////////////////////////////////////////////////
21
BasLogParams::BasLogParams
(
const
BasLogParams
& iLogParams)
22
: _logLevel (iLogParams._logLevel), _logStream (iLogParams._logStream),
23
_forceMultipleInit (iLogParams._forceMultipleInit) {
24
}
25
26
// //////////////////////////////////////////////////////////////////////
27
BasLogParams::BasLogParams
(
const
LOG::EN_LogLevel
iLogLevel,
28
std::ostream& ioLogOutputStream,
29
const
bool
iForceMultipleInstance)
30
: _logLevel (iLogLevel), _logStream (ioLogOutputStream),
31
_forceMultipleInit (iForceMultipleInstance) {
32
}
33
34
// //////////////////////////////////////////////////////////////////////
35
BasLogParams::~BasLogParams
() {
36
}
37
38
// //////////////////////////////////////////////////////////////////////
39
const
std::string
BasLogParams::describe
()
const
{
40
return
toString
();
41
}
42
43
// //////////////////////////////////////////////////////////////////////
44
std::string
BasLogParams::toShortString
()
const
{
45
const
std::string isForcedStr = (_forceMultipleInit ==
true
)?
" (forced)"
:
""
;
46
std::ostringstream oStr;
47
oStr <<
LOG::_logLevels
[_logLevel] << isForcedStr;
48
return
oStr.str();
49
}
50
51
// //////////////////////////////////////////////////////////////////////
52
std::string
BasLogParams::toString
()
const
{
53
std::ostringstream oStr;
54
oStr <<
LOG::_logLevels
[_logLevel];
55
return
oStr.str();
56
}
57
58
}
BasLogParams.hpp
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::LOG
Definition
stdair_log.hpp:17
stdair::LOG::EN_LogLevel
EN_LogLevel
Definition
stdair_log.hpp:18
stdair::LOG::DEBUG
@ DEBUG
Definition
stdair_log.hpp:23
stdair::LOG::_logLevels
static const std::string _logLevels[LAST_VALUE]
Definition
stdair_log.hpp:28
stdair::BasLogParams::describe
const std::string describe() const
Definition
BasLogParams.cpp:39
stdair::BasLogParams::toString
std::string toString() const
Definition
BasLogParams.cpp:52
stdair::BasLogParams::~BasLogParams
~BasLogParams()
Definition
BasLogParams.cpp:35
stdair::BasLogParams::toShortString
std::string toShortString() const
Definition
BasLogParams.cpp:44
stdair::BasLogParams::BasLogParams
BasLogParams(const LOG::EN_LogLevel iLogLevel, std::ostream &ioLogOutputStream, const bool iForceMultipleInstance=false)
Definition
BasLogParams.cpp:27
Generated for StdAir by
1.17.0