MillicastSDK 1.8.4
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
millicast::Logger Class Reference

#include <mc_logging.h>

Public Types

enum class  LogComponent { SDK , WEBRTC , WEBSOCKET }
 The LogComponent enum describes which components are possible to receive logs from in the log callback. More...
 

Static Public Member Functions

static MILLICAST_API void set_logger (std::function< void(const std::string &msg, LogLevel)> f)
 Set the object that will receive the logs from the SDK.
 
static MILLICAST_API void set_logger (std::function< void(const std::string &component, const std::string &msg, LogLevel)> f, std::vector< Logger::LogComponent > &&components)
 Set the object that will receive the logs from the SDK.
 
static MILLICAST_API void log (const std::string &msg, LogLevel lvl)
 Send a log to the callback logger.
 
static MILLICAST_API void log_version ()
 Log the version of the millicast SDK.
 
static MILLICAST_API std::string get_version ()
 Get the version of the SDK as a std string.
 
static MILLICAST_API void disable_rtc_logs ()
 Disable libwebrtc log message, except the error.
 
static MILLICAST_API void set_rtc_verbose (bool verbose)
 
static MILLICAST_API void disable_websocket_logs (bool disable)
 Disable websocket log message, except the error.
 
static MILLICAST_API void disable_all_logs ()
 Disable All log messages, except the error.
 
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 std::string get_webrtc_version ()
 

Member Enumeration Documentation

◆ LogComponent

The LogComponent enum describes which components are possible to receive logs from in the log callback.

Enumerator
SDK 
WEBRTC 
WEBSOCKET 

Member Function Documentation

◆ disable_all_logs()

static MILLICAST_API void millicast::Logger::disable_all_logs ( )
static

Disable All log messages, except the error.

◆ disable_rtc_logs()

static MILLICAST_API void millicast::Logger::disable_rtc_logs ( )
static

Disable libwebrtc log message, except the error.

◆ disable_websocket_logs()

static MILLICAST_API void millicast::Logger::disable_websocket_logs ( bool  disable)
static

Disable websocket log message, except the error.

Parameters
disablewhether to disable or not.

◆ 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()

static MILLICAST_API void millicast::Logger::log ( const std::string &  msg,
LogLevel  lvl 
)
static

Send a log to the callback logger.

Parameters
msgThe log message
lvlThe severity level

◆ log_version()

static MILLICAST_API void millicast::Logger::log_version ( )
static

Log the version of the millicast SDK.

◆ set_log_levels()

static MILLICAST_API void millicast::Logger::set_log_levels ( LogLevel  sdk,
LogLevel  webrtc = LogLevel::MC_OFF,
LogLevel  websocket = LogLevel::MC_OFF 
)
static

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() [1/2]

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 
)
static

Set the object that will receive the logs from the SDK.

Parameters
fThe 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.
componentsA vector containing the list of components you would like to receive log callbacks for.

◆ set_logger() [2/2]

static MILLICAST_API void millicast::Logger::set_logger ( std::function< void(const std::string &msg, LogLevel)>  f)
static

Set the object that will receive the logs from the SDK.

Parameters
fThe logger object (lambda, functor, function pointer ...)

◆ set_rtc_verbose()

static MILLICAST_API void millicast::Logger::set_rtc_verbose ( bool  verbose)
static

The documentation for this class was generated from the following file: