gphoto2pp
A C++ Wrapper for libgphoto2
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
helper_debugging.hpp
Go to the documentation of this file.
1 
25 #ifndef HELPERDEBUGGING_HPP
26 #define HELPERDEBUGGING_HPP
27 
28 #include "observer.hpp"
29 
30 namespace gphoto2pp
31 {
32  namespace helper
33  {
34  namespace debugging
35  {
36  enum class LogLevelWrapper : int
37  {
38  Error = 0, // Log message is an error infomation
39  Verbose = 1, // Log message is an verbose debug infomation
40  Debug = 2, // Log message is an debug infomation
41  Data = 3 // Log message is a data hex dump
42  };
43 
44  namespace detail
45  {
46  struct PortLoggingEventsManager : observer::SubjectEvent<LogLevelWrapper, void(LogLevelWrapper const &, std::string const &, std::string const &, void*)>
47  {
48  public:
49  PortLoggingEventsManager() = default;
51  void startPortLogging(const LogLevelWrapper& level);
52  void stopPortLogging();
53  private:
54  int id = 0;
55  };
56  }
57 
58  void startPortLogging(const LogLevelWrapper& level);
59  void stopPortLogging();
60 
61  observer::Registration subscribeToPortLogEvents(const LogLevelWrapper& event, std::function<void(LogLevelWrapper const & level, std::string const & domain, std::string const & str, void *data)> func);
62  }
63  }
64 }
65 
66 #endif // HELPERDEBUGGING_HPP