BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
OZWPocoLoggerAdapter.h
1 #pragma once
2 
3 #include <Poco/Logger.h>
4 #include <Poco/Message.h>
5 
6 #include <openzwave/platform/unix/LogImpl.h>
7 
8 namespace BeeeOn {
9 
30 class OZWPocoLoggerAdapter : public OpenZWave::i_LogImpl {
31 public:
32  OZWPocoLoggerAdapter(Poco::Logger& logger);
33 
41  void Write(OpenZWave::LogLevel logLevel, uint8 const nodeId,
42  char const* format, va_list args) override;
43 
47  void QueueDump() override;
48 
52  void QueueClear() override;
53 
57  void SetLoggingState(OpenZWave::LogLevel saveLevel,
58  OpenZWave::LogLevel queueLevel,
59  OpenZWave::LogLevel dumpTrigger) override;
60 
64  void SetLogFileName(const std::string& filename) override;
65 
66  static OpenZWave::LogLevel fromPocoLevel(int prio)
67  {
68  return fromPocoLevel(
69  static_cast<Poco::Message::Priority>(prio));
70  }
71 
72  static OpenZWave::LogLevel fromPocoLevel(Poco::Message::Priority prio);
73 
74 private:
75  Poco::Logger& logger;
76 };
77 
78 }
void SetLogFileName(const std::string &filename) override
The implementation does nothing.
Definition: OZWPocoLoggerAdapter.cpp:104
void QueueDump() override
The implementation does nothing.
Definition: OZWPocoLoggerAdapter.cpp:92
void Write(OpenZWave::LogLevel logLevel, uint8 const nodeId, char const *format, va_list args) override
Definition: OZWPocoLoggerAdapter.cpp:15
void SetLoggingState(OpenZWave::LogLevel saveLevel, OpenZWave::LogLevel queueLevel, OpenZWave::LogLevel dumpTrigger) override
The implementation does nothing.
Definition: OZWPocoLoggerAdapter.cpp:100
void QueueClear() override
The implementation does nothing.
Definition: OZWPocoLoggerAdapter.cpp:96
OZWPocoLoggerAdapter adapts the the logging infrastructure of the OpenZWave library to the Poco::Logg...
Definition: OZWPocoLoggerAdapter.h:30