WebRTC 日志

WebRTC 日志

flyfish

WebRTC支持的日志等级

cpp 复制代码
//
// The meanings of the levels are:
//  LS_VERBOSE: This level is for data which we do not want to appear in the
//   normal debug log, but should appear in diagnostic logs.
//  LS_INFO: Chatty level used in debugging for all sorts of things, the default
//   in debug builds.
//  LS_WARNING: Something that may warrant investigation.
//  LS_ERROR: Something that should not have occurred.
//  LS_NONE: Don't log.
enum LoggingSeverity {
  LS_VERBOSE,
  LS_INFO,
  LS_WARNING,
  LS_ERROR,
  LS_NONE,
};

源码所在路径

cpp 复制代码
webrtc/src/rtc_base/logging.h

使用方法

头文件

cpp 复制代码
#include "rtc_base/logging.h"

初始化

cpp 复制代码
rtc::LogMessage::LogToDebug((rtc::LoggingSeverity)rtc::LS_VERBOSE);

rtc::LogMessage::LogTimestamps();
rtc::LogMessage::LogThreads();
std::cout << "Logger level:" <<  rtc::LogMessage::GetLogToDebug() << std::endl;

调用方法

cpp 复制代码
RTC_LOG(LS_INFO) << "nb video devices:" << num_videoDevices;
RTC_LOG(LS_ERROR) << "LiveAudioSource::onNewSession not support codec" << sdp;
RTC_LOG(LS_VERBOSE) << "LiveVideoSource:onData SPS";
相关推荐
RTC老炮21 小时前
WebRTC下FlexFEC算法架构及原理
网络·算法·音视频·webrtc
换个昵称都难2 天前
webrtc源码下载(2026年4月)
webrtc
牛奶2 天前
不经过服务器,两个人怎么直接通话?
前端·websocket·webrtc
RTC老炮3 天前
音视频FEC前向纠错算法Reed-Solomon原理分析
网络·算法·架构·音视频·webrtc
dualven_in_csdn3 天前
【webrtc】ubuntu 编译中遇到的问题
webrtc
RTC老炮9 天前
RaptorQ前向纠错算法架构分析
网络·算法·架构·webrtc
许彰午10 天前
# 政务远程帮办:WebRTC视频通话+录屏录音+手工拼WAV实录
音视频·webrtc·政务
coder阿龙11 天前
基于PeerJS实现网页WebRTC屏幕分享
webrtc
RTC老炮11 天前
带宽估计算法(gcc++)架构设计及优化
网络·算法·webrtc
木斯佳12 天前
前端八股文面经大全:字节AIDP前端一面(2026-04-13)·面经深度解析
前端·音视频·webrtc·断点续传