using threads::Thread;
namespace main_namespace {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr LifeCycle::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("appMain"));
+#endif // ENABLE_LOG
namespace {
System::Thread* dbus_adapter_thread_;
#endif // QT_HMI
+# ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+# endif // ENABLE_LOG
DISALLOW_COPY_AND_ASSIGN(LifeCycle);
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_;
namespace commands {
+#ifdef ENABLE_LOG
extern log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
/**
* @brief Class is intended to encapsulate RPC as an object
smart_objects::SmartObject* prerecorded_speech_;
ApplicationManagerImpl* app_mngr_;
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
DISALLOW_COPY_AND_ASSIGN(HMICapabilities);
};
private:
HMICommandFactory();
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
DISALLOW_COPY_AND_ASSIGN(HMICommandFactory);
};
//! -------------------------------------------------------------
private:
+# ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+# endif // ENABLE_LOG
DISALLOW_COPY_AND_ASSIGN(MobileMessageHandler);
};
private:
PoliciesItems items_;
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
DISALLOW_COPY_AND_ASSIGN(PoliciesManager);
};
ApplicationSharedPtr app;
};
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
/**
* @brief Time step to check resumption TIME_OUT
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;
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;
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},
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) {
namespace application_manager {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr MobileMessageHandler::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("MobileMessageHandler"));
+#endif // ENABLE_LOG
application_manager::Message*
MobileMessageHandler::HandleIncomingMessageProtocolV1(
//! ---------------------------------------------------------------------------
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr PoliciesManager::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("PoliciesManager"));
+#endif // ENABLE_LOG
//! ---------------------------------------------------------------------------
#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)
/**
* \brief For logging.
*/
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
};
}/* namespace connection_handler */
/**
*\brief For logging.
*/
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
DISALLOW_COPY_AND_ASSIGN(ConnectionHandlerImpl);
FRIEND_BASE_SINGLETON_CLASS(ConnectionHandlerImpl);
/**
* \brief For logging.
*/
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
};
/**
*/
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,
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),
*/
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,
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)
const DBusSchema& get_schema() const;
protected:
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
/**
* \brief calls method on HMI
// 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);
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
namespace hmi_message_handler {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr HMIMessageHandlerImpl::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("HMIMessageHandler"));
+#endif // ENABLE_LOG
HMIMessageHandlerImpl::HMIMessageHandlerImpl()
: observer_(NULL),
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,
class A2DPSourcePlayerThread;
std::map<int32_t, threads::Thread*> sources_;
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
DISALLOW_COPY_AND_ASSIGN(A2DPSourcePlayerAdapter);
};
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);
};
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
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
void set_record_duration(int32_t duration);
private:
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
int32_t argc_;
gchar** argv_;
int32_t current_application_;
private:
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
DISALLOW_COPY_AND_ASSIGN(MediaAdapterImpl);
};
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);
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
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 {
bool exitThreadMain();
private:
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
// The Sample format to use
static const pa_sample_spec sSampleFormat_;
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_ = {
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)
namespace media_manager {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr FromMicRecorderAdapter::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("FromMicRecorderAdapter"));
+#endif // ENABLE_LOG
FromMicRecorderAdapter::FromMicRecorderAdapter()
: recorder_thread_(NULL)
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)
namespace media_manager {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr FromMicToFileRecorderThread::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("FromMicToFileRecorderThread"));
+#endif // ENABLE_LOG
GMainLoop* FromMicToFileRecorderThread::loop = NULL;
namespace media_manager {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr MediaAdapterImpl::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("MediaAdapterImpl"));
+#endif // ENABLE_LOG
MediaAdapterImpl::MediaAdapterImpl()
: current_application_(0) {
namespace media_manager {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr MediaManagerImpl::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("MediaManagerImpl"));
+#endif // ENABLE_LOG
MediaManagerImpl::MediaManagerImpl()
: protocol_handler_(NULL)
namespace media_manager {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr StreamerListener::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("StreamerListener"));
+#endif // ENABLE_LOG
StreamerListener::StreamerListener()
: current_application_(0) {
/**
* @brief Logger
*/
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
};
} // namespace policies
/**
* @brief Logger
*/
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
/**
* @brief Result of call of public method Init()
using ::NsSmartDeviceLink::NsSmartObjects::SmartObject;
using ::NsSmartDeviceLink::NsSmartObjects::SmartType;
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr PermissionsCalculator::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("Policies"));
+#endif // ENABLE_LOG
//----------------------------------------------------------------------------
namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr PolicyManagerImpl::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("Policies"));
+#endif // ENABLE_LOG
//---------------------------------------------------------------
/**
* \brief For logging.
*/
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
/**
*\brief Pointer on instance of class implementing IProtocolObserver
namespace protocol_handler {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr ProtocolHandlerImpl::logger_ = log4cxx::LoggerPtr(
log4cxx::Logger::getLogger("ProtocolHandler"));
+#endif // ENABLE_LOG
/**
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;
const ApplicationHandle app_handle_;
};
+#ifdef ENABLE_LOG
extern log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
} // namespace transport_adapter
} // namespace transport_manager
ClientConnectionListener* client_connection_listener_;
};
+#ifdef ENABLE_LOG
extern log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
} // namespace transport_adapter
} // namespace transport_manager
/**
* \brief For logging.
*/
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
TransportManagerImpl* transport_manager_impl_;
TransportAdapter* transport_adapter_;
};
/**
* \brief For logging.
*/
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
/**
* @brief store messages
namespace transport_manager {
+#ifdef ENABLE_LOG
log4cxx::LoggerPtr TransportAdapterListenerImpl::logger_ =
log4cxx::LoggerPtr(log4cxx::Logger::getLogger("TransportManager"));
+#endif // ENABLE_LOG
TransportAdapterListenerImpl::~TransportAdapterListenerImpl() {}
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;
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')
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)
#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_
ThreadOptions thread_options_;
bool isThreadRunning_;
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
private:
DISALLOW_COPY_AND_ASSIGN(Thread);
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;
protected:
ITransportAdapterListener & mListener;
IHandleGenerator & mHandleGenerator;
+#ifdef ENABLE_LOG
static log4cxx::LoggerPtr logger_;
+#endif // ENABLE_LOG
};
/**