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";
相关推荐
Fisher3Star6 小时前
mediasoup如何基于RTCP更新媒体流score
webrtc
hz567892 天前
2026 年 RTC 音视频 SDK 解析:技术架构、主流厂商与选型指南
架构·云计算·音视频·webrtc·实时音视频·信息与通信
Fisher3Star2 天前
mediasoup demo 遇到问题
webrtc
福大大架构师每日一题3 天前
pion/webrtc v4.2.13:SCTP统计信息曝光、DataChannel并发与关闭竞态修复、测试稳定性提升、依赖升级一次看懂
webrtc
Fisher3Star3 天前
Worker负责进程管理与网络I/O,Router专注媒体流路由与会话控制
webrtc
Fisher3Star3 天前
Mediasoup为何不需独立STUN服务器
webrtc
Fisher3Star5 天前
Simulcast多流自适应技术详解
webrtc
小爬的老粉丝5 天前
把 RTSP 摄像头请进浏览器:WebRTC 优先、原生桌面应用与超低延迟播放组件
webrtc
Fisher3Star5 天前
STUN协议核心作用与应用解析
webrtc
REDcker5 天前
WebRTC抖动缓冲详解
ffmpeg·webrtc