Changeset 123:b939555d5c9f in rrlib_logging


Ignore:
Timestamp:
18.06.2014 17:44:02 (6 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

Added missing '#ifdef _LIB_RRLIB_XML_PRESENT_'. Disabled linux-specific time output for none-linux systems.

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • configuration.cpp

    r111 r123  
    172172#endif 
    173173 
    174   RRLIB_LOG_PRINT(ERROR, "XML support not available due to missing rrlib_mca2_wrapper."); 
     174  RRLIB_LOG_PRINT(ERROR, "XML support not available due to missing rrlib_xml."); 
    175175  return false; 
    176176} 
  • configuration/tDomainRegistry.cpp

    r110 r123  
    112112  }); 
    113113 
    114  
     114#ifdef _LIB_RRLIB_XML_PRESENT_ 
    115115  sinks::tSinkFactory::Instance().Register<sinks::tStream>("stream"); 
    116116  sinks::tSinkFactory::Instance().Register<sinks::tFile>("file"); 
     
    118118#ifdef _LIB_RRLIB_LOGGING_SINKS_SPEECH_SYNTHESIS_PRESENT_ 
    119119  sinks::tSinkFactory::Instance().Register<sinks::tSpeechSynthesis>("speech_synthesis"); 
     120#endif 
    120121#endif 
    121122 
  • messages/implementation.cpp

    r110 r123  
    8383void SendFormattedTimeToStream(tStream &stream) 
    8484{ 
     85#if __linux__ 
    8586  char time_string_buffer[9]; 
    8687  timespec time; 
     
    9091  snprintf(nsec_string_buffer, sizeof(nsec_string_buffer), ".%09ld", time.tv_nsec); 
    9192  stream << "[ " << time_string_buffer << nsec_string_buffer << " ] "; 
     93#endif 
    9294} 
    9395 
  • messages/tStream.h

    r118 r123  
    202202  inline tStream &operator << (const rrlib::time::tTimestamp& value) 
    203203  { 
     204#if __linux__ 
    204205    this->stream << rrlib::time::ToIsoString(value); 
     206#else 
     207    this->stream << value.time_since_epoch().count(); 
     208#endif 
    205209    return *this; 
    206210  } 
  • sinks/tFile.cpp

    r110 r123  
    3636#include <string> 
    3737#include <stdexcept> 
     38#include <sstream> 
    3839 
    3940//---------------------------------------------------------------------- 
     
    8081{} 
    8182 
     83#ifdef _LIB_RRLIB_XML_PRESENT_ 
    8284tFile::tFile(const xml::tNode &node, const tConfiguration &configuration) : 
    8385  configuration(configuration) 
    8486{} 
     87#endif 
    8588 
    8689//---------------------------------------------------------------------- 
  • sinks/tFile.h

    r110 r123  
    4646#include <fstream> 
    4747 
     48#ifdef _LIB_RRLIB_XML_PRESENT_ 
    4849#include "rrlib/xml/tNode.h" 
     50#endif 
    4951 
    5052//---------------------------------------------------------------------- 
     
    8183 
    8284  tFile(const tConfiguration &configuration); 
     85#ifdef _LIB_RRLIB_XML_PRESENT_ 
    8386  tFile(const xml::tNode &node, const tConfiguration &configuration); 
     87#endif 
    8488 
    8589  virtual ~tFile(); 
  • sinks/tSink.h

    r119 r123  
    4343#include "rrlib/design_patterns/singleton.h" 
    4444 
     45#ifdef _LIB_RRLIB_XML_PRESENT_ 
    4546#include "rrlib/xml/tNode.h" 
     47#endif 
    4648 
    4749//---------------------------------------------------------------------- 
     
    7274//---------------------------------------------------------------------- 
    7375class tSink; 
     76 
     77#ifdef _LIB_RRLIB_XML_PRESENT_ 
    7478typedef design_patterns::tSingletonHolder<design_patterns::tFactory<tSink, std::string, std::function<tSink *(const xml::tNode &, const tConfiguration &)>>, design_patterns::singleton::PhoenixSingleton> tSinkFactory; 
     79#endif 
    7580 
    7681//---------------------------------------------------------------------- 
  • sinks/tSpeechSynthesis.cpp

    r110 r123  
    9393{} 
    9494 
     95#ifdef _LIB_RRLIB_XML_PRESENT_ 
    9596tSpeechSynthesis::tSpeechSynthesis(const xml::tNode &node, const tConfiguration &configuration) : 
    9697  stream_buffer(NULL) 
     
    103104  this->stream_buffer = SpeechStreamBufferFromVoiceString(node.GetStringAttribute("voice")); 
    104105} 
     106#endif 
    105107 
    106108//---------------------------------------------------------------------- 
  • sinks/tSpeechSynthesis.h

    r110 r123  
    7575 
    7676  tSpeechSynthesis(const std::string &voice); 
     77#ifdef _LIB_RRLIB_XML_PRESENT_ 
    7778  tSpeechSynthesis(const xml::tNode &node, const tConfiguration &configuration); 
     79#endif 
    7880 
    7981  ~tSpeechSynthesis(); 
  • sinks/tStream.cpp

    r120 r123  
    9595{} 
    9696 
     97#ifdef _LIB_RRLIB_XML_PRESENT_ 
    9798tStream::tStream(const xml::tNode &node, const tConfiguration &configuration) : 
    9899  stream_buffer(NULL) 
     
    105106  this->stream_buffer = IdToStreamBuffer(node.GetStringAttribute("id")); 
    106107} 
     108#endif 
    107109 
    108110//---------------------------------------------------------------------- 
  • sinks/tStream.h

    r110 r123  
    4444// External includes (system with <>, local with "") 
    4545//---------------------------------------------------------------------- 
     46#ifdef _LIB_RRLIB_XML_PRESENT_ 
    4647#include "rrlib/xml/tNode.h" 
     48#endif 
    4749 
    4850//---------------------------------------------------------------------- 
     
    8082 
    8183  tStream(const std::string &id); 
     84#ifdef _LIB_RRLIB_XML_PRESENT_ 
    8285  tStream(const xml::tNode &node, const tConfiguration &configuration); 
     86#endif 
    8387 
    8488  virtual std::streambuf &GetStreamBuffer(); 
Note: See TracChangeset for help on using the changeset viewer.