13#ifndef OPENSHOT_LOGGER_H
14#define OPENSHOT_LOGGER_H
34 std::recursive_mutex loggerMutex;
35 std::string connection;
38 std::string file_path;
39 std::ofstream log_file;
43 zmq::context_t *context;
46 zmq::socket_t *publisher;
53 ZmqLogger(ZmqLogger
const&) =
delete;
56 ZmqLogger & operator=(ZmqLogger
const&) =
delete;
59 ZmqLogger(ZmqLogger
const&) {};
62 ZmqLogger & operator=(ZmqLogger
const&);
66 static ZmqLogger * m_pInstance;
74 std::string method_name,
75 std::string arg1_name=
"",
float arg1_value=-1.0,
76 std::string arg2_name=
"",
float arg2_value=-1.0,
77 std::string arg3_name=
"",
float arg3_value=-1.0,
78 std::string arg4_name=
"",
float arg4_value=-1.0,
79 std::string arg5_name=
"",
float arg5_value=-1.0,
80 std::string arg6_name=
"",
float arg6_value=-1.0
90 void Enable(
bool is_enabled) { enabled = is_enabled;};
93 void Path(std::string new_path);
96 void Log(std::string message);
void Close()
Close logger (sockets and/or files).
void Enable(bool is_enabled)
Enable/Disable logging.
void Log(std::string message)
Log message to all subscribers of this logger (if any).
void Path(std::string new_path)
Set or change the file path (optional).
void LogToFile(std::string message)
Log message to a file (if path set).
void Connection(std::string new_connection)
Set or change connection info for logger (i.e. tcp://*:5556).
void AppendDebugMethod(std::string method_name, std::string arg1_name="", float arg1_value=-1.0, std::string arg2_name="", float arg2_value=-1.0, std::string arg3_name="", float arg3_value=-1.0, std::string arg4_name="", float arg4_value=-1.0, std::string arg5_name="", float arg5_value=-1.0, std::string arg6_name="", float arg6_value=-1.0)
Append debug information.
static ZmqLogger * Instance()
Create or get an instance of this logger singleton (invoke the class with this method).
This namespace is the default namespace for all code in the openshot library.