OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #import <Foundation/Foundation.h> | 11 #import <Foundation/Foundation.h> |
12 | 12 |
13 typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) { | 13 typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) { |
14 kRTCFileLoggerSeverityVerbose, | 14 RTCFileLoggerSeverityVerbose, |
15 kRTCFileLoggerSeverityInfo, | 15 RTCFileLoggerSeverityInfo, |
16 kRTCFileLoggerSeverityWarning, | 16 RTCFileLoggerSeverityWarning, |
17 kRTCFileLoggerSeverityError | 17 RTCFileLoggerSeverityError |
18 }; | 18 }; |
19 | 19 |
20 typedef NS_ENUM(NSUInteger, RTCFileLoggerRotationType) { | 20 typedef NS_ENUM(NSUInteger, RTCFileLoggerRotationType) { |
21 kRTCFileLoggerTypeCall, | 21 RTCFileLoggerTypeCall, |
22 kRTCFileLoggerTypeApp, | 22 RTCFileLoggerTypeApp, |
23 }; | 23 }; |
24 | 24 |
| 25 NS_ASSUME_NONNULL_BEGIN |
| 26 |
25 // This class intercepts WebRTC logs and saves them to a file. The file size | 27 // This class intercepts WebRTC logs and saves them to a file. The file size |
26 // will not exceed the given maximum bytesize. When the maximum bytesize is | 28 // will not exceed the given maximum bytesize. When the maximum bytesize is |
27 // reached, logs are rotated according to the rotationType specified. | 29 // reached, logs are rotated according to the rotationType specified. |
28 // For kRTCFileLoggerTypeCall, logs from the beginning and the end | 30 // For kRTCFileLoggerTypeCall, logs from the beginning and the end |
29 // are preserved while the middle section is overwritten instead. | 31 // are preserved while the middle section is overwritten instead. |
30 // For kRTCFileLoggerTypeApp, the oldest log is overwritten. | 32 // For kRTCFileLoggerTypeApp, the oldest log is overwritten. |
31 // This class is not threadsafe. | 33 // This class is not threadsafe. |
32 @interface RTCFileLogger : NSObject | 34 @interface RTCFileLogger : NSObject |
33 | 35 |
34 // The severity level to capture. The default is kRTCFileLoggerSeverityInfo. | 36 // The severity level to capture. The default is kRTCFileLoggerSeverityInfo. |
(...skipping 25 matching lines...) Expand all Loading... |
60 - (void)start; | 62 - (void)start; |
61 | 63 |
62 // Stops writing WebRTC logs to disk. This method is also called on dealloc. | 64 // Stops writing WebRTC logs to disk. This method is also called on dealloc. |
63 - (void)stop; | 65 - (void)stop; |
64 | 66 |
65 // Returns the current contents of the logs, or nil if start has been called | 67 // Returns the current contents of the logs, or nil if start has been called |
66 // without a stop. | 68 // without a stop. |
67 - (NSData *)logData; | 69 - (NSData *)logData; |
68 | 70 |
69 @end | 71 @end |
| 72 |
| 73 NS_ASSUME_NONNULL_END |
| 74 |
OLD | NEW |