| 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 #import "webrtc/base/objc/RTCMacros.h" |
| 14 |
| 13 typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) { | 15 typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) { |
| 14 RTCFileLoggerSeverityVerbose, | 16 RTCFileLoggerSeverityVerbose, |
| 15 RTCFileLoggerSeverityInfo, | 17 RTCFileLoggerSeverityInfo, |
| 16 RTCFileLoggerSeverityWarning, | 18 RTCFileLoggerSeverityWarning, |
| 17 RTCFileLoggerSeverityError | 19 RTCFileLoggerSeverityError |
| 18 }; | 20 }; |
| 19 | 21 |
| 20 typedef NS_ENUM(NSUInteger, RTCFileLoggerRotationType) { | 22 typedef NS_ENUM(NSUInteger, RTCFileLoggerRotationType) { |
| 21 RTCFileLoggerTypeCall, | 23 RTCFileLoggerTypeCall, |
| 22 RTCFileLoggerTypeApp, | 24 RTCFileLoggerTypeApp, |
| 23 }; | 25 }; |
| 24 | 26 |
| 25 NS_ASSUME_NONNULL_BEGIN | 27 NS_ASSUME_NONNULL_BEGIN |
| 26 | 28 |
| 27 // This class intercepts WebRTC logs and saves them to a file. The file size | 29 // This class intercepts WebRTC logs and saves them to a file. The file size |
| 28 // will not exceed the given maximum bytesize. When the maximum bytesize is | 30 // will not exceed the given maximum bytesize. When the maximum bytesize is |
| 29 // reached, logs are rotated according to the rotationType specified. | 31 // reached, logs are rotated according to the rotationType specified. |
| 30 // For kRTCFileLoggerTypeCall, logs from the beginning and the end | 32 // For kRTCFileLoggerTypeCall, logs from the beginning and the end |
| 31 // are preserved while the middle section is overwritten instead. | 33 // are preserved while the middle section is overwritten instead. |
| 32 // For kRTCFileLoggerTypeApp, the oldest log is overwritten. | 34 // For kRTCFileLoggerTypeApp, the oldest log is overwritten. |
| 33 // This class is not threadsafe. | 35 // This class is not threadsafe. |
| 36 RTC_EXPORT |
| 34 @interface RTCFileLogger : NSObject | 37 @interface RTCFileLogger : NSObject |
| 35 | 38 |
| 36 // The severity level to capture. The default is kRTCFileLoggerSeverityInfo. | 39 // The severity level to capture. The default is kRTCFileLoggerSeverityInfo. |
| 37 @property(nonatomic, assign) RTCFileLoggerSeverity severity; | 40 @property(nonatomic, assign) RTCFileLoggerSeverity severity; |
| 38 | 41 |
| 39 // The rotation type for this file logger. The default is | 42 // The rotation type for this file logger. The default is |
| 40 // kRTCFileLoggerTypeCall. | 43 // kRTCFileLoggerTypeCall. |
| 41 @property(nonatomic, readonly) RTCFileLoggerRotationType rotationType; | 44 @property(nonatomic, readonly) RTCFileLoggerRotationType rotationType; |
| 42 | 45 |
| 43 // Disables buffering disk writes. Should be set before |start|. Buffering | 46 // Disables buffering disk writes. Should be set before |start|. Buffering |
| (...skipping 21 matching lines...) Expand all Loading... |
| 65 - (void)stop; | 68 - (void)stop; |
| 66 | 69 |
| 67 // Returns the current contents of the logs, or nil if start has been called | 70 // Returns the current contents of the logs, or nil if start has been called |
| 68 // without a stop. | 71 // without a stop. |
| 69 - (NSData *)logData; | 72 - (NSData *)logData; |
| 70 | 73 |
| 71 @end | 74 @end |
| 72 | 75 |
| 73 NS_ASSUME_NONNULL_END | 76 NS_ASSUME_NONNULL_END |
| 74 | 77 |
| OLD | NEW |