StdAir Logo  1.00.12
C++ Standard Airline IT Object Library
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
10
11namespace 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 // //////////////////////////////////////////////////////////////////////
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}
Handle on the StdAir library context.
static const std::string _logLevels[LAST_VALUE]
Definition: stdair_log.hpp:28
Structure holding parameters for logging.
const std::string describe() const
std::string toString() const
std::string toShortString() const