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";
相关推荐
换个昵称都难10 天前
webrtc peerconnection_server 模块介绍
运维·服务器·webrtc
EasyGBS10 天前
延迟直降90%!国标GB28181视频平台EasyGBS支持WebRTC WHIP推流设备接入,让万物互联更简单
音视频·webrtc
换个昵称都难11 天前
webrtc RtpRtcp模块化测试-MockRtpRtcp
webrtc
如意IT11 天前
指纹浏览器检测之BrowserScan的webrtc指纹检测和反检测
自动化·webrtc·chromium·浏览器开发
换个昵称都难11 天前
webrtc TURN 主要源码介绍
webrtc
换个昵称都难11 天前
webrtc RTC_P2P源码解析
asp.net·webrtc·p2p
换个昵称都难11 天前
webrtc StunServer源码介绍
webrtc
数据知道12 天前
指纹浏览器:DNS 泄漏防范与 WebRTC 本地 IP 屏蔽的底层实现
爬虫·网络协议·tcp/ip·安全·webrtc·数据采集·指纹浏览器
换个昵称都难13 天前
webrtc源码解析概要介绍
webrtc
换个昵称都难13 天前
WebRTC 完整调用流程(前端纯 JS 实现,最简可运行)
webrtc