Changeset 111:6b1805a2d957 in rrlib_logging


Ignore:
Timestamp:
25.10.2013 02:17:14 (7 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Children:
112:919c243ec8d0, 113:1b3ac8fd3a2a
Phase:
public
Message:

Removed deprecated functions

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • configuration.cpp

    r110 r111  
    140140 
    141141//---------------------------------------------------------------------- 
    142 // SetDomainSink 
    143 //---------------------------------------------------------------------- 
    144 void SetDomainSink(const std::string &domain_name, tLogSink sink_1, tLogSink sink_2, tLogSink sink_3, tLogSink sink_4, const tDefaultConfigurationContext &default_context) 
    145 { 
    146   const_cast<tConfiguration &>(tDomainRegistry::Instance().GetConfiguration(default_context, NULL, domain_name.c_str())).SetSinkMask(sink_1 | sink_2 | sink_3 | sink_4); 
    147 } 
    148  
    149 //---------------------------------------------------------------------- 
    150142// PrintDomainConfigurations 
    151143//---------------------------------------------------------------------- 
     
    241233  { 
    242234    configuration.SetMaxMessageLevel(node.GetEnumAttribute<tLogLevel>("max_level")); 
    243   } 
    244  
    245   if (node.HasAttribute("sink")) 
    246   { 
    247     RRLIB_LOG_PRINT(WARNING, "Use of the sink attribute in xml configuration for rrlib_logging is deprecated. Use sink taggroup instead."); 
    248     configuration.SetSinkMask(1 << node.GetEnumAttribute<tLogSink>("sink")); 
    249   } 
    250  
    251   int sink_mask = 0; 
    252   for (xml::tNode::const_iterator it = node.ChildrenBegin(); it != node.ChildrenEnd(); ++it) 
    253   { 
    254     if (it->Name() == "sink") 
    255     { 
    256       if (it->HasAttribute("output")) 
    257       { 
    258         sink_mask |= 1 << it->GetEnumAttribute<tLogSink>("output"); 
    259       } 
    260     } 
    261   } 
    262   if (sink_mask != 0) 
    263   { 
    264     RRLIB_LOG_PRINT(WARNING, "Use of the output attribute in <sink> is deprecated. Use <stream>, <file>, etc. instead."); 
    265     configuration.SetSinkMask(sink_mask); 
    266235  } 
    267236 
  • configuration.h

    r110 r111  
    8181void SetDomainMaxMessageLevel(const std::string &domain_name, tLogLevel level, const tDefaultConfigurationContext &default_context = cDEFAULT_CONTEXT); 
    8282 
    83 void SetDomainSink(const std::string &domain_name, tLogSink sink_1, tLogSink sink_2 = (tLogSink)0, tLogSink sink_3 = (tLogSink)0, tLogSink sink_4 = (tLogSink)0, const tDefaultConfigurationContext &default_context = cDEFAULT_CONTEXT) __attribute__((deprecated)); 
    84  
    8583void PrintDomainConfigurations(); 
    8684 
  • configuration/tConfiguration.cpp

    r110 r111  
    6767// Const values 
    6868//---------------------------------------------------------------------- 
    69 const int cLOG_SINK_COMBINED_FILE_CHILD_MASK = 1 << eLOG_SINK_DIMENSION; 
    7069 
    7170//---------------------------------------------------------------------- 
     
    158157  { 
    159158    (*it)->SetMaxMessageLevel(level); 
    160   } 
    161 } 
    162  
    163 //---------------------------------------------------------------------- 
    164 // tConfiguration SetSinkMask 
    165 //---------------------------------------------------------------------- 
    166 void tConfiguration::SetSinkMask(int sink_mask) 
    167 { 
    168   this->ClearSinks(); 
    169   if (sink_mask | eLOG_SINK_STDOUT) 
    170   { 
    171     this->AddSink(std::shared_ptr<sinks::tSink>(new sinks::tStream("stdout"))); 
    172   } 
    173   if (sink_mask | eLOG_SINK_STDERR) 
    174   { 
    175     this->AddSink(std::shared_ptr<sinks::tSink>(new sinks::tStream("stderr"))); 
    176   } 
    177   if (sink_mask | eLOG_SINK_FILE) 
    178   { 
    179     std::cerr << "INFO: The meaning of this sink changed to be the same as combined file. There will be one file for the whole subtree starting at " << this->GetFullQualifiedName() << std::endl; 
    180     this->AddSink(std::shared_ptr<sinks::tSink>(new sinks::tFile(*this))); 
    181   } 
    182   if (sink_mask | eLOG_SINK_COMBINED_FILE) 
    183   { 
    184     this->AddSink(std::shared_ptr<sinks::tSink>(new sinks::tFile(*this))); 
    185159  } 
    186160} 
  • configuration/tConfiguration.h

    r110 r111  
    9292// Forward declarations / typedefs / enums 
    9393//---------------------------------------------------------------------- 
    94  
    95  
    96 //! Enumeration type that contains the available sinks for message domains 
    97 enum tLogSink 
    98 { 
    99   eLOG_SINK_STDOUT,          //!< Messages are printed to stdout 
    100   eLOG_SINK_STDERR,          //!< Messages are printed to stderr 
    101   eLOG_SINK_FILE,            //!< Messages are printed to single files for each subdomain 
    102   eLOG_SINK_COMBINED_FILE,   //!< Messages are printed into one combined file 
    103   eLOG_SINK_DIMENSION        //!< Endmarker and dimension of tLogSink 
    104 } __attribute__((deprecated)); 
    105  
    10694struct tDefaultConfigurationContext 
    10795{ 
     
    163151  void SetPrintsLocation(bool value); 
    164152  void SetMaxMessageLevel(tLogLevel level); 
    165   void SetSinkMask(int sink_mask) __attribute__((deprecated)); 
    166153  void ClearSinks(); 
    167154  void AddSink(std::shared_ptr<sinks::tSink> sink); 
Note: See TracChangeset for help on using the changeset viewer.