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";
相关推荐
Fisher3Star5 天前
mediasoup Transport详解与代码实现
webrtc
Fisher3Star6 天前
mediasoup中Node.js与Worker进程通信机制
网络·webrtc
911hzh7 天前
Flutter WebRTC iOS 原理解析:从 getUserMedia 到 Texture,讲清视频采集、纹理渲染与远端通话链路
flutter·ios·webrtc
shao9185167 天前
第12章Streaming(下):视频应用(1)——项目八:基于WebRTC+YOLO的实时目标检测
yolo·目标检测·webrtc·gradio·视频流·yolov10·流式传输
三十_7 天前
WebRTC 远端画面无法显示:ICE 与 SDP 时序问题深度解析与解决方案
webrtc
metaRTC9 天前
metaRTC8 成功适配 RTOS:开启 MCU/嵌入式实时音视频新时代
单片机·嵌入式硬件·webrtc·实时音视频·rtos
Fisher3Star10 天前
mediasoup中ip与announceAddress配置要点
webrtc·sdp
小柯博客10 天前
Amazon Kinesis Video Streams C WebRTC SDK 开发实战
c语言·开发语言·网络·stm32·嵌入式硬件·webrtc·yocto
RTC老炮12 天前
WebRTC下FlexFEC算法架构及原理
网络·算法·音视频·webrtc
换个昵称都难12 天前
webrtc源码下载(2026年4月)
webrtc