StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
BasLogParams.cpp
Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <iostream>
00007 #include <sstream>
00008 // StdAir
00009 #include <stdair/basic/BasLogParams.hpp>
00010 
00011 namespace stdair {
00012 
00013   // //////////////////////////////////////////////////////////////////////
00014   BasLogParams::BasLogParams()
00015     : _logLevel (LOG::DEBUG), _logStream (std::cout),
00016       _forceMultipleInit (false) {
00017     assert (false);
00018   }
00019   
00020   // //////////////////////////////////////////////////////////////////////
00021   BasLogParams::BasLogParams (const BasLogParams& iLogParams)
00022     : _logLevel (iLogParams._logLevel), _logStream (iLogParams._logStream),
00023       _forceMultipleInit (iLogParams._forceMultipleInit) {
00024   }
00025   
00026   // //////////////////////////////////////////////////////////////////////
00027   BasLogParams::BasLogParams (const LOG::EN_LogLevel iLogLevel,
00028                               std::ostream& ioLogOutputStream,
00029                               const bool iForceMultipleInstance)
00030     : _logLevel (iLogLevel), _logStream (ioLogOutputStream),
00031       _forceMultipleInit (iForceMultipleInstance) {
00032   }
00033   
00034   // //////////////////////////////////////////////////////////////////////
00035   BasLogParams::~BasLogParams() {
00036   }
00037   
00038   // //////////////////////////////////////////////////////////////////////
00039   const std::string BasLogParams::describe() const {
00040     return toString();
00041   }
00042 
00043   // //////////////////////////////////////////////////////////////////////
00044   std::string BasLogParams::toShortString() const {
00045     const std::string isForcedStr = (_forceMultipleInit == true)?" (forced)":"";
00046     std::ostringstream oStr;
00047     oStr << LOG::_logLevels[_logLevel] << isForcedStr;
00048     return oStr.str();
00049   }
00050     
00051   // //////////////////////////////////////////////////////////////////////
00052   std::string BasLogParams::toString() const {
00053     std::ostringstream oStr;
00054     oStr << LOG::_logLevels[_logLevel];
00055     return oStr.str();
00056   }
00057     
00058 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines