#include <mc_logging.h>
◆ LogComponent
The LogComponent enum describes which components are possible to receive logs from in the log callback.
Enumerator |
---|
SDK | |
WEBRTC | |
WEBSOCKET | |
◆ get_version()
static MILLICAST_API std::string millicast::Logger::get_version |
( |
| ) |
|
|
static |
Get the version of the SDK as a std string.
- Returns
- The version of the SDK
◆ get_webrtc_version()
static MILLICAST_API std::string millicast::Logger::get_webrtc_version |
( |
| ) |
|
|
static |
◆ log()
Send a log to the callback logger.
- Parameters
-
msg | The log message |
lvl | The severity level |
◆ log_version()
Log the version of the millicast SDK.
◆ set_log_levels()
Set log levels for the core SDK, webrtc and websocket.
Note: setting log levels is not atomic, and some log messages may be dropped. It is recommended to not modify the log levels while the client is connected.
◆ set_logger()
static MILLICAST_API void millicast::Logger::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 |
|
) |
| |
|
static |
Set the object that will receive the logs from the SDK.
- Note
- When this object is set, it will disable the automatic logging to stderr that happens on desktop platforms to avoid double logging. If you would like to keep the logs to stderr and in the callback set the final boolean parameter to true.
-
If this API is invoked more than once, the first time that StdErr logs are removed we assume you will not be adding them back. So subsequent calls setting force_stderr_log = true will not do anything if the API has be invoked with the value as false at least once.
- Parameters
-
f | The logger object with first parameter being description of the component the log came from, the second being the message itself and finally the log level. |
components | A vector containing the list of components you would like to receive log callbacks for. |
for_stderr_log | A boolean which will ensure on desktops that logs are always also printed to stderr even when the log callback is set. |
The documentation for this class was generated from the following file: