blob: 669f2a3e4a14bf373a3edfdb5c67e1017c066267 [file] [log] [blame]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001/*
2 * Copyright 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#import <Foundation/Foundation.h>
12
13#import "RTCLogging.h"
14#import "RTCMacros.h"
15
16NS_ASSUME_NONNULL_BEGIN
17
18// This class intercepts WebRTC logs and forwards them to a registered block.
19// This class is not threadsafe.
20RTC_EXPORT
21@interface RTCCallbackLogger : NSObject
22
23// The severity level to capture. The default is kRTCLoggingSeverityInfo.
24@property(nonatomic, assign) RTCLoggingSeverity severity;
25
26// The callback will be called on the same thread that does the logging, so
27// if the logging callback can be slow it may be a good idea to implement
28// dispatching to some other queue.
29- (void)start:(nullable void (^)(NSString*))callback;
30
31- (void)stop;
32
33@end
34
35NS_ASSUME_NONNULL_END