ENABLE_LOG option added to turn logger completely off
authorDmitry Chmerev <dchmerev@luxoft.com>
Sat, 29 Mar 2014 17:35:04 +0000 (21:35 +0400)
committerJustin Dickow <jjdickow@gmail.com>
Tue, 8 Jul 2014 22:22:52 +0000 (18:22 -0400)
62 files changed:
src/appMain/life_cycle.cc
src/appMain/life_cycle.h
src/components/application_manager/include/application_manager/application_manager_impl.h
src/components/application_manager/include/application_manager/commands/command_impl.h
src/components/application_manager/include/application_manager/hmi_capabilities.h
src/components/application_manager/include/application_manager/hmi_command_factory.h
src/components/application_manager/include/application_manager/mobile_message_handler.h
src/components/application_manager/include/application_manager/policies_manager/policies_manager.h
src/components/application_manager/include/application_manager/resume_ctrl.h
src/components/application_manager/src/application_manager_impl.cc
src/components/application_manager/src/commands/command_impl.cc
src/components/application_manager/src/hmi_capabilities.cc
src/components/application_manager/src/hmi_command_factory.cc
src/components/application_manager/src/mobile_message_handler.cc
src/components/application_manager/src/policies_manager/policies_manager.cc
src/components/application_manager/src/resume_ctrl.cpp
src/components/connection_handler/include/connection_handler/connection.h
src/components/connection_handler/include/connection_handler/connection_handler_impl.h
src/components/connection_handler/include/connection_handler/device.h
src/components/connection_handler/src/connection.cc
src/components/connection_handler/src/connection_handler_impl.cc
src/components/connection_handler/src/device.cc
src/components/dbus/codegen/make_qml_dbus_cpp.py
src/components/dbus/include/dbus/dbus_adapter.h
src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h
src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
src/components/hmi_message_handler/src/messagebroker_adapter.cc
src/components/media_manager/include/media_manager/audio/a2dp_source_player_adapter.h
src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h
src/components/media_manager/include/media_manager/audio/from_mic_recorder_adapter.h
src/components/media_manager/include/media_manager/audio/from_mic_recorder_listener.h
src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
src/components/media_manager/include/media_manager/media_adapter_impl.h
src/components/media_manager/include/media_manager/media_manager_impl.h
src/components/media_manager/include/media_manager/streamer_listener.h
src/components/media_manager/src/audio/a2dp_source_player_adapter.cc
src/components/media_manager/src/audio/audio_stream_sender_thread.cc
src/components/media_manager/src/audio/from_mic_recorder_adapter.cc
src/components/media_manager/src/audio/from_mic_recorder_listener.cc
src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
src/components/media_manager/src/media_adapter_impl.cc
src/components/media_manager/src/media_manager_impl.cc
src/components/media_manager/src/streamer_listener.cc
src/components/policies/include/policies/permissions_calculator.h
src/components/policies/include/policies/policy_manager_impl.h
src/components/policies/src/permissions_calculator.cc
src/components/policies/src/policy_manager_impl.cc
src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h
src/components/protocol_handler/src/protocol_handler_impl.cc
src/components/request_watchdog/src/request_watchdog.cc
src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
src/components/transport_manager/include/transport_manager/transport_manager_impl.h
src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
src/components/transport_manager/src/transport_manager_impl.cc
src/components/transport_manager/src/usb/libusb/usb_connection.cc
src/components/utils/include/utils/logger.h
src/components/utils/include/utils/threads/thread.h
src/components/utils/src/threads/posix_thread.cc
test/components/transport_manager/TransportManagerTestWithMultiThreadedClient.cpp

index 7c6c928..2e04128 100644 (file)
 using threads::Thread;
 
 namespace main_namespace {
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr LifeCycle::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("appMain"));
+#endif // ENABLE_LOG
 
 namespace {
 
index e916065..f6ed4e6 100644 (file)
@@ -98,7 +98,9 @@ class LifeCycle : public utils::Singleton<LifeCycle> {
     System::Thread* dbus_adapter_thread_;
 #endif  // QT_HMI
 
+#   ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#   endif // ENABLE_LOG
 
     DISALLOW_COPY_AND_ASSIGN(LifeCycle);
 
index b82a64f..33a0659 100644 (file)
@@ -582,7 +582,9 @@ class ApplicationManagerImpl : public ApplicationManager,
     hmi_apis::HMI_API*                      hmi_so_factory_;
     mobile_apis::MOBILE_API*                mobile_so_factory_;
 
+#   ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#   endif // ENABLE_LOG
 
     static uint32_t corelation_id_;
     static const uint32_t max_corelation_id_;
index 8fab40e..d12a2e8 100644 (file)
@@ -40,7 +40,9 @@ namespace application_manager {
 
 namespace commands {
 
+#ifdef ENABLE_LOG
 extern log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
 /**
  * @brief Class is intended to encapsulate RPC as an object
index 93d3428..6fa0403 100644 (file)
@@ -405,7 +405,9 @@ class HMICapabilities {
   smart_objects::SmartObject*      prerecorded_speech_;
 
   ApplicationManagerImpl*          app_mngr_;
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
   DISALLOW_COPY_AND_ASSIGN(HMICapabilities);
 };
index de0fa7e..e12051a 100644 (file)
@@ -56,7 +56,9 @@ class HMICommandFactory {
 
  private:
   HMICommandFactory();
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
   DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
 };
 
index 5d7be9a..20d46a7 100644 (file)
@@ -58,7 +58,9 @@ class MobileMessageHandler {
 
     //! -------------------------------------------------------------
   private:
+#   ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#   endif // ENABLE_LOG
 
     DISALLOW_COPY_AND_ASSIGN(MobileMessageHandler);
 };
index 88aeb0c..2ba1dfd 100644 (file)
@@ -167,7 +167,9 @@ class ResumeCtrl: public event_engine::EventObserver {
       ApplicationSharedPtr app;
     };
 
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
     /**
      * @brief Time step to check resumption TIME_OUT
index 512588b..9a19301 100644 (file)
 
 namespace application_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr ApplicationManagerImpl::logger_ = log4cxx::LoggerPtr(
-      log4cxx::Logger::getLogger("ApplicationManager"));
+    log4cxx::Logger::getLogger("ApplicationManager"));
+#endif // ENABLE_LOG
 
 uint32_t ApplicationManagerImpl::corelation_id_ = 0;
 const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX;
index 95d96bd..02e3362 100644 (file)
@@ -36,8 +36,10 @@ namespace application_manager {
 
 namespace commands {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("Commands"));
+#endif
 
 const int32_t CommandImpl::hmi_protocol_type_ = 1;
 const int32_t CommandImpl::mobile_protocol_type_ = 0;
index 589185d..be6eb94 100644 (file)
 
 namespace application_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr HMICapabilities::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("HMICapabilities"));
+#endif
 std::map<std::string, hmi_apis::Common_Language::eType> languages_enum_values =
 {
     {"EN_US", hmi_apis::Common_Language::EN_US},
index e0dbea0..2e31890 100644 (file)
 
 namespace application_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr HMICommandFactory::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("ApplicationManager"));
+#endif // ENABLE_LOG
 
 CommandSharedPtr HMICommandFactory::CreateCommand(
     const MessageSharedPtr& message) {
index 94c2772..1dec9d2 100644 (file)
@@ -50,8 +50,10 @@ const uint8_t kUnknown = 0xF;
 
 namespace application_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr MobileMessageHandler::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("MobileMessageHandler"));
+#endif // ENABLE_LOG
 
 application_manager::Message*
 MobileMessageHandler::HandleIncomingMessageProtocolV1(
index 408d26c..a7754d8 100644 (file)
@@ -120,8 +120,10 @@ namespace policies_manager {
 
 //! ---------------------------------------------------------------------------
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr PoliciesManager::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("PoliciesManager"));
+#endif // ENABLE_LOG
 
 //! ---------------------------------------------------------------------------
 
index a1db687..e9d8ffe 100644 (file)
 #include "resumption/last_state.h"
 
 namespace application_manager {
+#ifdef ENABLE_LOG
   log4cxx::LoggerPtr ResumeCtrl::logger_ = log4cxx::LoggerPtr(
         log4cxx::Logger::getLogger("ResumeCtrl"));
+#endif // ENABLE_LOG
 namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
 
 ResumeCtrl::ResumeCtrl(ApplicationManagerImpl* app_mngr)
index 7bad902..df95460 100644 (file)
@@ -200,7 +200,9 @@ class Connection {
   /**
    * \brief For logging.
    */
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 };
 
 }/* namespace connection_handler */
index 31277b4..aef4c45 100644 (file)
@@ -309,7 +309,9 @@ class ConnectionHandlerImpl : public ConnectionHandler,
     /**
      *\brief For logging.
      */
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
     DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl);
 
     FRIEND_BASE_SINGLETON_CLASS(ConnectionHandlerImpl);
index b480aeb..355d72a 100644 (file)
@@ -104,7 +104,9 @@ class Device {
     /**
      * \brief For logging.
      */
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 };
 
 /**
index 1ffecb5..38596d6 100644 (file)
  */
 namespace connection_handler {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr Connection::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("ConnectionHandler"));
+#endif // ENABLE_LOG
 
 Connection::Connection(ConnectionHandle connection_handle,
                        DeviceHandle connection_device_handle,
index 995526f..1dc3934 100644 (file)
@@ -62,8 +62,10 @@ transport_manager::ConnectionUID ConnectionUIDFromHandle(ConnectionHandle handle
   return transport_manager::ConnectionUID(handle);
 }
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr ConnectionHandlerImpl::logger_ = log4cxx::LoggerPtr(
-      log4cxx::Logger::getLogger("ConnectionHandler"));
+    log4cxx::Logger::getLogger("ConnectionHandler"));
+#endif // ENABLE_LOG
 
 ConnectionHandlerImpl::ConnectionHandlerImpl()
   : connection_handler_observer_(NULL),
index 35c9acb..7746d6d 100644 (file)
  */
 namespace connection_handler {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr Device::logger_ = log4cxx::LoggerPtr(
                                        log4cxx::Logger::getLogger("ConnectionHandler"));
+#endif // ENABLE_LOG
 
 Device::Device(DeviceHandle device_handle,
                const std::string& user_friendly_name,
index 9107813..be44d58 100755 (executable)
@@ -728,7 +728,9 @@ source_out.write("""/**
 source_out.write("#include \"" + header_name + "\"\n\n");
 source_out.write("#include <log4cxx/logger.h>\n")
 source_out.write("#include <log4cxx/propertyconfigurator.h>\n\n")
-source_out.write("extern log4cxx::LoggerPtr logger_;\n\n")
+source_out.write("#ifdef ENABLE_LOG\n")
+source_out.write("extern log4cxx::LoggerPtr logger_;\n")
+source_out.write("#endif // ENABLE_LOG\n\n")
 impl.make_dbus_type_definitions(source_out)
 impl.make_dbus_adaptor_definitions(source_out)
 impl.make_dbus_register_metatypes_definition(source_out)
index a704fc9..b7660d0 100644 (file)
@@ -79,7 +79,9 @@ class DBusAdapter {
   const DBusSchema& get_schema() const;
 
  protected:
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
   /**
    * \brief calls method on HMI
index 4800f30..f6839aa 100644 (file)
@@ -113,7 +113,9 @@ class HMIMessageHandlerImpl
   // Thread that pumps messages being passed to hmi.
   impl::ToHmiQueue messages_to_hmi_;
 
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
   DISALLOW_COPY_AND_ASSIGN(HMIMessageHandlerImpl);
 
index 6bd2447..d91963c 100644 (file)
@@ -82,7 +82,9 @@ class MessageBrokerAdapter : public HMIMessageAdapter,
   static const std::string ADDRESS;
   static const uint16_t PORT;
 
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
   DISALLOW_COPY_AND_ASSIGN(MessageBrokerAdapter);
 };
 }  //  namespace hmi_message_handler
index 7df82fd..48dcbf7 100644 (file)
 
 namespace hmi_message_handler {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr HMIMessageHandlerImpl::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("HMIMessageHandler"));
+#endif // ENABLE_LOG
 
 HMIMessageHandlerImpl::HMIMessageHandlerImpl()
     : observer_(NULL),
index ef23dc3..1eecc2c 100644 (file)
@@ -39,8 +39,10 @@ namespace hmi_message_handler {
 
 typedef NsMessageBroker::CMessageBrokerController MessageBrokerController;
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr MessageBrokerAdapter::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("HMIMessageHandler"));
+#endif // ENABLE_LOG
 
 MessageBrokerAdapter::MessageBrokerAdapter(HMIMessageHandler* handler_param,
                                            const std::string& server_address,
index ae84335..4711334 100644 (file)
@@ -58,7 +58,9 @@ class A2DPSourcePlayerAdapter : public MediaAdapterImpl {
     class A2DPSourcePlayerThread;
 
     std::map<int32_t, threads::Thread*> sources_;
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
     DISALLOW_COPY_AND_ASSIGN(A2DPSourcePlayerAdapter);
 };
 
index c5ee323..74c1d13 100644 (file)
@@ -126,7 +126,9 @@ class AudioStreamSenderThread : public threads::ThreadDelegate {
     sync_primitives::Lock shouldBeStoped_lock_;
 
     static const int32_t kAudioPassThruTimeout;
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
     DISALLOW_COPY_AND_ASSIGN(AudioStreamSenderThread);
 };
index f49526a..9d1bad6 100644 (file)
@@ -59,7 +59,9 @@ class FromMicRecorderAdapter : public MediaAdapterImpl {
     std::string output_file_;
     int32_t duration_;
     const int32_t kDefaultDuration;
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
     DISALLOW_COPY_AND_ASSIGN(FromMicRecorderAdapter);
 };
 }  // namespace media_manager
index 37896b3..c1c451f 100644 (file)
@@ -59,7 +59,9 @@ class FromMicRecorderListener : public MediaAdapterListener {
     threads::Thread* reader_;
     std::string file_name_;
     int32_t current_application_;
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
     DISALLOW_COPY_AND_ASSIGN(FromMicRecorderListener);
 };
 }  //  namespace media_manager
index ff0af43..d9eeddb 100644 (file)
@@ -56,7 +56,9 @@ class FromMicToFileRecorderThread : public threads::ThreadDelegate {
     void set_record_duration(int32_t duration);
 
   private:
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
     int32_t argc_;
     gchar** argv_;
index 20d44b4..a7d0234 100644 (file)
@@ -56,7 +56,9 @@ class MediaAdapterImpl : public MediaAdapter {
     int32_t current_application_;
 
   private:
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
     DISALLOW_COPY_AND_ASSIGN(MediaAdapterImpl);
 };
index 87f948a..d0e84a3 100644 (file)
@@ -82,7 +82,9 @@ class MediaManagerImpl : public MediaManager,
     bool                               audio_stream_active_;
 
   private:
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
     DISALLOW_COPY_AND_ASSIGN(MediaManagerImpl);
 
     FRIEND_BASE_SINGLETON_CLASS(MediaManagerImpl);
index df9da33..7210a1a 100644 (file)
@@ -53,7 +53,9 @@ class StreamerListener : public MediaAdapterListener {
     virtual void OnActivityEnded(int32_t application_key);
   private:
     int32_t current_application_;
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
     DISALLOW_COPY_AND_ASSIGN(StreamerListener);
 };
 }  //  namespace media_manager
index 892c638..6e59b0e 100644 (file)
 
 namespace media_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr A2DPSourcePlayerAdapter::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("A2DPSourcePlayerAdapter"));
+#endif // ENABLE_LOG
 
 class A2DPSourcePlayerAdapter::A2DPSourcePlayerThread
     : public threads::ThreadDelegate {
@@ -55,7 +57,9 @@ class A2DPSourcePlayerAdapter::A2DPSourcePlayerThread
     bool exitThreadMain();
 
   private:
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
     // The Sample format to use
     static const pa_sample_spec sSampleFormat_;
@@ -159,8 +163,10 @@ bool A2DPSourcePlayerAdapter::is_app_performing_activity(int32_t
   return (application_key == current_application_);
 }
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::logger_ =
   log4cxx::LoggerPtr(log4cxx::Logger::getLogger("A2DPSourcePlayerThread"));
+#endif // ENABLE_LOG
 
 const pa_sample_spec A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::
 sSampleFormat_ = {
index 14b0333..e690093 100644 (file)
@@ -54,8 +54,10 @@ namespace media_manager {
 using sync_primitives::AutoLock;
 
 const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1;
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr AudioStreamSenderThread::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("AudioPassThruThread"));
+#endif // ENABLE_LOG
 
 AudioStreamSenderThread::AudioStreamSenderThread(
   const std::string fileName, uint32_t session_key)
index 94fec18..4eb3f3c 100644 (file)
 
 namespace media_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr FromMicRecorderAdapter::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("FromMicRecorderAdapter"));
+#endif // ENABLE_LOG
 
 FromMicRecorderAdapter::FromMicRecorderAdapter()
   : recorder_thread_(NULL)
index a64e476..a44b6ce 100644 (file)
 
 namespace media_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr FromMicRecorderListener::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("FromMicRecorderListener"));
+#endif // ENABLE_LOG
 
 FromMicRecorderListener::FromMicRecorderListener(
   const std::string& file_name)
index 1763957..adf31de 100644 (file)
 
 namespace media_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr FromMicToFileRecorderThread::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("FromMicToFileRecorderThread"));
+#endif // ENABLE_LOG
 
 GMainLoop* FromMicToFileRecorderThread::loop = NULL;
 
index 24e25a6..bfa072f 100644 (file)
 
 namespace media_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr MediaAdapterImpl::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("MediaAdapterImpl"));
+#endif // ENABLE_LOG
 
 MediaAdapterImpl::MediaAdapterImpl()
   : current_application_(0) {
index e692d88..94e042b 100644 (file)
 
 namespace media_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr MediaManagerImpl::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("MediaManagerImpl"));
+#endif // ENABLE_LOG
 
 MediaManagerImpl::MediaManagerImpl()
   : protocol_handler_(NULL)
index 656476b..8a7e024 100644 (file)
 
 namespace media_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr StreamerListener::logger_ = log4cxx::LoggerPtr(
       log4cxx::Logger::getLogger("StreamerListener"));
+#endif // ENABLE_LOG
 
 StreamerListener::StreamerListener()
   : current_application_(0) {
index c96ebaa..810b2d6 100644 (file)
@@ -132,7 +132,9 @@ class PermissionsCalculator {
     /**
      * @brief Logger
      */
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 };
 
 }  // namespace policies
index adfddf8..04acab7 100644 (file)
@@ -109,7 +109,9 @@ class PolicyManagerImpl : public PolicyManager,
     /**
      * @brief Logger
      */
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
     /**
      * @brief Result of call of public method Init()
index 240ed13..08ec8b2 100644 (file)
@@ -48,8 +48,10 @@ namespace jsonhandler = NsSmartDeviceLink::NsJSONHandler;
 using ::NsSmartDeviceLink::NsSmartObjects::SmartObject;
 using ::NsSmartDeviceLink::NsSmartObjects::SmartType;
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr PermissionsCalculator::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("Policies"));
+#endif // ENABLE_LOG
 
 //----------------------------------------------------------------------------
 
index 095cdc0..8599572 100644 (file)
@@ -41,8 +41,10 @@ namespace policies {
 
 namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr PolicyManagerImpl::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("Policies"));
+#endif // ENABLE_LOG
 
 //---------------------------------------------------------------
 
index aafae07..92bc51d 100644 (file)
@@ -416,7 +416,9 @@ class ProtocolHandlerImpl
     /**
      * \brief For logging.
      */
+#ifdef ENABLE_LOG
     static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
     /**
      *\brief Pointer on instance of class implementing IProtocolObserver
index 251546c..707dbef 100644 (file)
 
 namespace protocol_handler {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr ProtocolHandlerImpl::logger_ = log4cxx::LoggerPtr(
     log4cxx::Logger::getLogger("ProtocolHandler"));
+#endif // ENABLE_LOG
 
 
 /**
index aafbdf3..b7396dc 100644 (file)
@@ -46,8 +46,10 @@ using namespace sync_primitives;
 
 const int32_t RequestWatchdog::DEFAULT_CYCLE_TIMEOUT;
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr RequestWatchdog::logger_ =
   log4cxx::LoggerPtr(log4cxx::Logger::getLogger("RequestWatchdog"));
+#endif // ENABLE_LOG
 /*
 Watchdog* RequestWatchdog::instance() {
   static RequestWatchdog instnc;
index 1778e5e..8192caf 100644 (file)
@@ -157,7 +157,9 @@ class ThreadedSocketConnection : public Connection {
   const ApplicationHandle app_handle_;
 };
 
+#ifdef ENABLE_LOG
 extern log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
 }  // namespace transport_adapter
 }  // namespace transport_manager
index ac22931..b66d27f 100644 (file)
@@ -490,7 +490,9 @@ class TransportAdapterImpl : public TransportAdapter,
   ClientConnectionListener* client_connection_listener_;
 };
 
+#ifdef ENABLE_LOG
 extern log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
 }  // namespace transport_adapter
 }  // namespace transport_manager
index 3a9975e..2493975 100644 (file)
@@ -294,7 +294,9 @@ class TransportAdapterListenerImpl
   /**
    * \brief For logging.
    */
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
   TransportManagerImpl* transport_manager_impl_;
   TransportAdapter* transport_adapter_;
 };
index fa74fad..409e227 100755 (executable)
@@ -330,7 +330,9 @@ class TransportManagerImpl : public TransportManager {
   /**
    * \brief For logging.
    */
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
   /**
    * @brief store messages
index a4c9e00..7cbd01f 100644 (file)
 
 namespace transport_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr TransportAdapterListenerImpl::logger_ =
     log4cxx::LoggerPtr(log4cxx::Logger::getLogger("TransportManager"));
+#endif // ENABLE_LOG
 
 TransportAdapterListenerImpl::~TransportAdapterListenerImpl() {}
 
index cba7c73..3d9ecd5 100644 (file)
@@ -58,8 +58,10 @@ using ::transport_manager::transport_adapter::TransportAdapter;
 
 namespace transport_manager {
 
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr TransportManagerImpl::logger_ =
     log4cxx::LoggerPtr(log4cxx::Logger::getLogger("TransportManager"));
+#endif // ENABLE_LOG
 
 TransportManagerImpl::Connection TransportManagerImpl::convert(TransportManagerImpl::ConnectionInternal& p) {
   TransportManagerImpl::Connection c;
index 00c792d..9a1b4c8 100644 (file)
@@ -105,7 +105,7 @@ bool UsbConnection::PostInTransfer() {
 
 void UsbConnection::OnInTransfer(libusb_transfer* transfer) {
   if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
-    if (logger_->isTraceEnabled()) {
+    if (LOG4CXX_IS_TRACE_ENABLED(logger_)) {
       std::ostringstream hexdata;
       for (int i = 0; i < transfer->actual_length; ++i) {
         hexdata << " " << std::hex << std::setw(2) << std::setfill('0')
index a88c6aa..a8dd7cb 100644 (file)
 
 namespace log4cxx
 {
+
+#ifdef ENABLE_LOG
+    #define LOG4CXX_IS_TRACE_ENABLED(logger) logger->isTraceEnabled()
+
     #define LOG4CXX_INFO_EXT(logger, logEvent) LOG4CXX_INFO(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
     #define LOG4CXX_INFO_STR_EXT(logger, logEvent) LOG4CXX_INFO_STR(logger, __PRETTY_FUNCTION__ << ": " << logEvent)
 
@@ -64,6 +68,52 @@ namespace log4cxx
     #define LOG4CXX_TRACE_EXIT(logger) LOG4CXX_TRACE(logger, "EXIT: " << __PRETTY_FUNCTION__ )
 
     #define LOG4CXX_ERROR_WITH_ERRNO(logger, message) LOG4CXX_ERROR(logger, message << ", error code " << errno << " (" << strerror(errno) << ")")
+#else
+    #define LOG4CXX_IS_TRACE_ENABLED(logger) false
+
+    #undef LOG4CXX_INFO
+    #define LOG4CXX_INFO(x,y)
+
+    #undef LOG4CXX_WARN
+    #define LOG4CXX_WARN(x,y)
+
+    #undef LOG4CXX_ERROR
+    #define LOG4CXX_ERROR(x,y)
+
+    #undef LOG4CXX_ERROR_WITH_ERRNO
+    #define LOG4CXX_ERROR_WITH_ERRNO(x,y)
+
+    #undef LOG4CXX_TRACE
+    #define LOG4CXX_TRACE(x,y)
+
+    #undef LOG4CXX_DEBUG
+    #define LOG4CXX_DEBUG(x,y)
+
+    #undef LOG4CXX_FATAL
+    #define LOG4CXX_FATAL(x,y)
+
+    #define LOG4CXX_INFO_EXT(logger, logEvent)
+    #define LOG4CXX_INFO_STR_EXT(logger, logEvent)
+
+    #define LOG4CXX_TRACE_EXT(logger, logEvent)
+    #define LOG4CXX_TRACE_STR_EXT(logger, logEvent)
+
+    #define LOG4CXX_DEBUG_EXT(logger, logEvent)
+    #define LOG4CXX_DEBUG_STR_EXT(logger, logEvent)
+
+    #define LOG4CXX_WARN_EXT(logger, logEvent)
+    #define LOG4CXX_WARN_STR_EXT(logger, logEvent)
+
+    #define LOG4CXX_ERROR_EXT(logger, logEvent)
+    #define LOG4CXX_ERROR_STR_EXT(logger, logEvent)
+
+    #define LOG4CXX_FATAL_EXT(logger, logEvent)
+    #define LOG4CXX_FATAL_STR_EXT(logger, logEvent)
+
+    #define LOG4CXX_TRACE_ENTER(logger)
+    #define LOG4CXX_TRACE_EXIT(logger)
+
+#endif // ENABLE_LOG
 }
 
 #define LOG4CXXLOGGER_HPP_
index bbe0acd..a8b4441 100644 (file)
@@ -223,7 +223,9 @@ class Thread {
   ThreadOptions thread_options_;
   bool isThreadRunning_;
 
+#ifdef ENABLE_LOG
   static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
 
  private:
   DISALLOW_COPY_AND_ASSIGN(Thread);
index 719b3d4..bc43d4a 100644 (file)
@@ -50,8 +50,10 @@ static void* threadFunc(void* closure) {
 
 namespace threads {
 size_t Thread::kMinStackSize = PTHREAD_STACK_MIN; /* Ubuntu : 16384 ; QNX : 256; */
+#ifdef ENABLE_LOG
 log4cxx::LoggerPtr Thread::logger_ =
   log4cxx::LoggerPtr(log4cxx::Logger::getLogger("threads::Thread"));
+#endif // ENABLE_LOG
 
 bool Thread::Id::operator==(const Thread::Id other) const {
   return pthread_equal(id_, other.id_) != 0;
index a930c03..4ff4a63 100644 (file)
@@ -164,7 +164,9 @@ namespace test { namespace components { namespace TransportManager { namespace T
     protected:
         ITransportAdapterListener & mListener;
         IHandleGenerator & mHandleGenerator;
+#ifdef ENABLE_LOG
         static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
     };
 
     /**