MillicastSDK 2.5.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
4#ifdef __cplusplus
5
13#include <atomic>
14#include <functional>
15#include <string>
16#include <vector>
17
18#include "exports.h"
19
20namespace millicast {
21
26enum class LogLevel {
27 MC_OFF,
28 MC_ERROR,
29 MC_WARNING,
31 MC_LOG,
32 MC_DEBUG,
33 MC_VERBOSE
34};
35
36class Logger {
37 public:
42 enum class LogComponent { SDK, WEBRTC, WEBSOCKET };
43
62 MILLICAST_API static void set_logger(
63 std::function<void(const std::string& component,
64 const std::string& msg,
65 LogLevel)> f,
66 std::vector<Logger::LogComponent>&& components,
67 bool force_stderr_log = false);
68
74 MILLICAST_API static void log(const std::string& msg, LogLevel lvl);
75
79 MILLICAST_API static void log_version();
80
85 MILLICAST_API static std::string get_version();
86
94 MILLICAST_API static void set_log_levels(
95 LogLevel sdk,
96 LogLevel webrtc = LogLevel::MC_OFF,
97 LogLevel websocket = LogLevel::MC_OFF);
98
99 MILLICAST_API static std::string get_webrtc_version();
100};
101
102} // namespace millicast
103
104#endif // MC_LOGGING_H
105#endif // __cplusplus
#define MILLICAST_API
Definition exports.h:51