00001 #ifndef _IT_BUS_PDK_BUS_LOGGER_DELEGATE_H_
00002 #define _IT_BUS_PDK_BUS_LOGGER_DELEGATE_H_
00003
00004
00005
00006 #include <it_bus/bus_logger.h>
00007
00008 namespace IT_Bus
00009 {
00010 namespace Logging
00011 {
00012 class ServiceNameRetriever;
00013
00014 class IT_BUS_API BusLoggerDelegate
00015 {
00016 public:
00017
00018 BusLoggerDelegate(
00019 IT_Bus::Bus_ptr bus,
00020 const char* subsystem
00021 );
00022
00023 ~BusLoggerDelegate();
00024
00025 void
00026 write_log_record(
00027 ServiceNameRetriever* snr,
00028 IT_TraceLevel trace_level,
00029 const char* description,
00030 ...);
00031
00032 void
00033 write_log_record_with_CDATA(
00034 ServiceNameRetriever* snr,
00035 IT_TraceLevel trace_level,
00036 const char* description,
00037 const char* data_buffer,
00038 long buffer_size
00039 );
00040
00041 void
00042 write_log_record_with_binary(
00043 ServiceNameRetriever* snr,
00044 IT_TraceLevel trace_level,
00045 const char* description,
00046 const char* data_buffer,
00047 long buffer_size
00048 );
00049
00050 IT_Bool
00051 is_loggable(
00052 IT_TraceLevel level
00053 );
00054
00055 IT_Bool
00056 is_loggable_subsystem(
00057 IT_TraceLevel level
00058 );
00059
00060 IT_TraceLevel
00061 get_subsystem_log_filter();
00062
00063 IT_TraceLevel
00064 get_bus_master_log_filter();
00065
00066 BusLoggerDelegate*
00067 operator->()
00068 {
00069 return this;
00070 }
00071
00072 private:
00073
00074 BusLoggerDelegate& operator=(const BusLoggerDelegate& rhs);
00075 BusLoggerDelegate(const BusLoggerDelegate& rhs);
00076
00077 Bus_ptr m_bus;
00078 BusLogger* m_logger;
00079 };
00080 }
00081 }
00082
00083 #define IT_INIT_BUS_LOGGER_LOCAL(bus) IT_Bus::Logging::BusLoggerDelegate _it_bus_logger(bus,_IT_SUBSYSTEM_SCOPE);
00084
00085 #endif