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";
相关推荐
EasyGBS2 天前
RTSP、RTMP、HLS、FLV、WebRTC……国标GB28181视频平台EasyGBS五大流媒体协议,你的场景该用哪个?
音视频·webrtc
REDcker3 天前
libdatachannel 快速入门
c++·webrtc·datachannel
冯程6 天前
WebRTC 之 AllocationSequence 详解
webrtc·音视频开发
阿拉斯攀登8 天前
售货柜实战:IPC 拉流 → 抽帧 → YOLO 识别完整流水线
yolo·ffmpeg·音视频·webrtc·视频编解码
阿拉斯攀登9 天前
RTSP 拉流与录制:IPC 摄像头本地录像完整方案
ffmpeg·音视频·webrtc·实时音视频·视频编解码
阿拉斯攀登9 天前
数据通道:RTCDataChannel 可靠与不可靠传输
音视频·webrtc·实时音视频·媒体·视频编解码
REDcker9 天前
腾讯TRRO SDK深度剖析
音视频·webrtc·实时音视频·直播·rtc·腾讯
阿拉斯攀登10 天前
FFmpeg 转码详解:封装格式、编码器、码率控制
ffmpeg·音视频·webrtc·实时音视频·视频编解码
阿拉斯攀登10 天前
FFmpeg 入门:命令行的 20 个常用场景
ffmpeg·音视频·webrtc·视频编解码
阿拉斯攀登10 天前
媒体流与轨道:MediaStream 与 MediaStreamTrack
嵌入式硬件·webrtc·实时音视频·媒体·视频编解码