MillicastSDK 2.0.0
Loading...
Searching...
No Matches
mc_logging.h
Go to the documentation of this file.
1#ifndef MC_LOGGING_H
2#define MC_LOGGING_H
3
11#include <atomic>
12#include <functional>
13#include <string>
14
16
17namespace millicast {
18
23enum class LogLevel {
24 MC_OFF,
25 MC_ERROR,
28 MC_LOG,
29 MC_DEBUG,
31};
32
33class Logger {
34 public:
39 enum class LogComponent { SDK, WEBRTC, WEBSOCKET };
40
60 std::function<void(const std::string& component,
61 const std::string& msg,
62 LogLevel)> f,
63 std::vector<Logger::LogComponent>&& components,
64 bool force_stderr_log = false);
65
71 MILLICAST_API static void log(const std::string& msg, LogLevel lvl);
72
77
82 MILLICAST_API static std::string get_version();
83
92 LogLevel sdk,
94 LogLevel websocket = LogLevel::MC_OFF);
95
96 MILLICAST_API static std::string get_webrtc_version();
97};
98
99} // namespace millicast
100
101#endif // MC_LOGGING_H
Definition mc_logging.h:33
static MILLICAST_API void log_version()
Log the version of the millicast SDK.
static MILLICAST_API void set_log_levels(LogLevel sdk, LogLevel webrtc=LogLevel::MC_OFF, LogLevel websocket=LogLevel::MC_OFF)
Set log levels for the core SDK, webrtc and websocket.
static MILLICAST_API void set_logger(std::function< void(const std::string &component, const std::string &msg, LogLevel)> f, std::vector< Logger::LogComponent > &&components, bool force_stderr_log=false)
Set the object that will receive the logs from the SDK.
static MILLICAST_API std::string get_version()
Get the version of the SDK as a std string.
LogComponent
The LogComponent enum describes which components are possible to receive logs from in the log callbac...
Definition mc_logging.h:39
static MILLICAST_API std::string get_webrtc_version()
static MILLICAST_API void log(const std::string &msg, LogLevel lvl)
Send a log to the callback logger.
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
LogLevel
The LogLevel enum specify the severity of a log message.
Definition mc_logging.h:23