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";
相关推荐
lqg_zone1 天前
基于 Socket.IO 实现 WebRTC 音视频通话与实时聊天系统(Spring Boot 后端实现)
spring boot·音视频·webrtc
圆心角3 天前
webrtc的核心原理
前端·webrtc
Antonio9154 天前
【音视频】WebRTC 一对一通话-信令服
c++·websocket·音视频·webrtc
Antonio9154 天前
【音视频】WebRTC 一对一通话-Web端
前端·音视频·webrtc
DogDaoDao4 天前
WebRTC音视频编码模块深度解析:从编解码器到自适应码率控制(2025技术实践)
音视频·webrtc·实时音视频·视频编解码·h264·vp9·svc编码
Antonio9154 天前
【音视频】WebRTC 一对一通话-实现概述
音视频·webrtc
Antonio9155 天前
【音视频】WebRTC 中的RTP、RTCP、SDP、Candidate
音视频·webrtc
DogDaoDao5 天前
WebRTC前处理模块技术详解:音频3A处理与视频优化实践
音视频·webrtc·实时音视频·视频增强·视频前处理·3a算法·音频前处理
RTC老炮6 天前
webrtc弱网-QualityScaler 源码分析与算法原理
人工智能·算法·webrtc
亲爱的非洲野猪6 天前
实时语音流分段识别技术解析:基于WebRTC VAD的智能分割策略
webrtc