OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // This class intercepts WebRTC logs and saves them to a file. The file size | 42 // This class intercepts WebRTC logs and saves them to a file. The file size |
43 // will not exceed the given maximum bytesize. When the maximum bytesize is | 43 // will not exceed the given maximum bytesize. When the maximum bytesize is |
44 // reached logs from the beginning and the end are preserved while the middle | 44 // reached logs from the beginning and the end are preserved while the middle |
45 // section is overwritten instead. | 45 // section is overwritten instead. |
46 // This class is not threadsafe. | 46 // This class is not threadsafe. |
47 @interface RTCFileLogger : NSObject | 47 @interface RTCFileLogger : NSObject |
48 | 48 |
49 // The severity level to capture. The default is kRTCFileLoggerSeverityInfo. | 49 // The severity level to capture. The default is kRTCFileLoggerSeverityInfo. |
50 @property(nonatomic, assign) RTCFileLoggerSeverity severity; | 50 @property(nonatomic, assign) RTCFileLoggerSeverity severity; |
51 | 51 |
52 // Default constructor provides default settings for file path and file size. | 52 // Default constructor provides default settings for dir path and file size. |
53 - (instancetype)init; | 53 - (instancetype)init; |
54 | 54 |
55 - (instancetype)initWithFilePath:(NSString *)filePath | 55 - (instancetype)initWithDirPath:(NSString *)dirPath |
56 maxFileSize:(NSUInteger)maxFileSize | 56 maxFileSize:(NSUInteger)maxFileSize |
57 NS_DESIGNATED_INITIALIZER; | 57 NS_DESIGNATED_INITIALIZER; |
58 | 58 |
59 // Starts writing WebRTC logs to file if not already started. Overwrites any | 59 // Starts writing WebRTC logs to disk if not already started. Overwrites any |
60 // existing file. | 60 // existing file(s). |
61 - (void)start; | 61 - (void)start; |
62 | 62 |
63 // Stops writing WebRTC logs to file. Rewrites the log file as required to | 63 // Stops writing WebRTC logs to disk. This method is also called on dealloc. |
64 // reorder logs because logs may be disordered due to use of | |
65 // rtc::CircularFileStream. This method is also called on dealloc. | |
66 - (void)stop; | 64 - (void)stop; |
67 | 65 |
68 // Returns the current contents of the log file. Returns nil if start has been | 66 // Returns the current contents of the logs, or nil if start has been called |
69 // called without a stop, or if there is no data. | 67 // without a stop. |
70 - (NSData *)logData; | 68 - (NSData *)logData; |
71 | 69 |
72 @end | 70 @end |
OLD | NEW |