当前位置:网站首页>Callback webrtc underlying logs to the application layer
Callback webrtc underlying logs to the application layer
2022-06-12 08:14:00 【oneboyishappy】
1. Create subclass inheritance ::rtc::LogSink The underlying log class
enum LoggingSeverity {
LS_VERBOSE,
LS_INFO,
LS_WARNING,
LS_ERROR,
LS_NONE,
};
class RtcFileLog : public ::rtc::LogSink {
int SetLogFile(const char* filePath);
int SetLogFileSize(unsigned int size);
}
// Not android
void RtcFileLog::OnLogMessage(const std::string& msg,
::rtc::LoggingSeverity severity) {
... Writing documents
}
// android
void RtcFileLog::OnLogMessage(const std::string& msg,
::rtc::LoggingSeverity severity, const char* tag) {
... Writing documents
}2. establish ::rtc::LogSink Log subclass , Set the callback class to rtc The bottom layer reports logs
std::unique_ptr<RtcFileLog> m_rtcFileLog;
if (!m_rtcFileLog){
m_rtcFileLog.reset(new RtcFileLog());
}
// Initialize the log module
rtc::LogMessage::LogToDebug(::rtc::LS_INFO);
rtc::LogMessage::LogTimestamps(true);
rtc::LogMessage::LogThreads(true);
// Set write file path
m_rtcFileLog->SetLogFile(log_path.c_str());
// Add implementation class
rtc::LogMessage::RemoveLogToStream(m_rtcFileLog.get());
rtc::LogMessage::AddLogToStream(m_rtcFileLog.get(), ::rtc::LS_INFO);边栏推荐
- ctfshow web4
- Debug debugging cmake code under clion, including debugging process under ROS environment
- Record the treading pit of grain Mall (I)
- Installation series of ROS system (II): ROS rosdep init/update error reporting solution
- 电气火灾探测器对各用电回路进行实时监控
- 制造企业生产排产现状和APS系统的解决方案
- ERP的生产管理与MES管理系统有什么差别?
- FPGA to flip video up and down (SRAM is61wv102416bll)
- (p25-p26) three details of non range based for loop and range based for loop
- PPP agreement
猜你喜欢

C # hide the keyboard input on the console (the input content is not displayed on the window)

FPGA implementation of right and left flipping of 720p image

Talk about the four basic concepts of database system

Asp Net project add log function

Alibaba cloud deploys VMware and reports an error

Py&GO编程技巧篇:逻辑控制避免if else

计组第一章

(P27-P32)可调用对象、可调用对象包装器、可调用对象绑定器

MATLAB image processing -- image transformation correction second-order fitting

Vision transformer | arXiv 2205 - TRT vit vision transformer for tensorrt
随机推荐
Installation series of ROS system (I): installation steps
企业上MES系统的驱动力来自哪里?选型又该注意哪些问题?
EasyExcel导出Excel表格到浏览器,并通过Postman测试导出Excel【入门案例】
超全MES系统知识普及,必读此文
Principes et exemples de tâches OpenMP
Procedure execution failed 1449 exception
Principle and example of OpenMP task
Derivation of Poisson distribution
Bean的作用域
vm虚拟机中使用NAT模式特别说明
StrVec类 移动拷贝
Prediction of COVID-19 by RNN network
Transformation from AC5 to AC6 (1) - remedy and preparation
C # push box
目前MES应用很多,为什么APS排程系统很少,原因何在?
What kind of sparks will be generated when the remote sensing satellite meets the Beidou navigation satellite?
Quaternion Hanmilton and JPL conventions
模型压缩 | TIP 2022 - 蒸馏位置自适应:Spot-adaptive Knowledge Distillation
Asp Net project add log function
Face recognition using BP neural network of NNET in R language