Add severity into RTC logging callbacks

Bug: webrtc:9945
Change-Id: I5022f63103503d2213492d3cd1a6953fe658fda7
Reviewed-on: https://webrtc-review.googlesource.com/c/108981
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25510}
This commit is contained in:
Jiawei Ou
2018-10-31 23:14:24 -07:00
committed by Commit Bot
parent edfb883c85
commit 3ea187803b
7 changed files with 195 additions and 15 deletions

View File

@ -15,6 +15,10 @@
NS_ASSUME_NONNULL_BEGIN
typedef void (^RTCCallbackLoggerMessageHandler)(NSString *message);
typedef void (^RTCCallbackLoggerMessageAndSeverityHandler)(NSString *message,
RTCLoggingSeverity severity);
// This class intercepts WebRTC logs and forwards them to a registered block.
// This class is not threadsafe.
RTC_OBJC_EXPORT
@ -23,10 +27,12 @@ RTC_OBJC_EXPORT
// The severity level to capture. The default is kRTCLoggingSeverityInfo.
@property(nonatomic, assign) RTCLoggingSeverity severity;
// The callback will be called on the same thread that does the logging, so
// if the logging callback can be slow it may be a good idea to implement
// dispatching to some other queue.
- (void)start:(nullable void (^)(NSString*))callback;
// The callback handler will be called on the same thread that does the
// logging, so if the logging callback can be slow it may be a good idea
// to implement dispatching to some other queue.
- (void)start:(nullable RTCCallbackLoggerMessageHandler)handler;
- (void)startWithMessageAndSeverityHandler:
(nullable RTCCallbackLoggerMessageAndSeverityHandler)handler;
- (void)stop;