Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: talk/app/webrtc/objc/public/RTCFileLogger.h

Issue 1217473011: AppRTCDemo file logging. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * libjingle
3 * Copyright 2015 Google Inc.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 #import <Foundation/Foundation.h>
29
30 // TODO(tkchin): Move this to a common location.
31 #ifndef NS_DESIGNATED_INITIALIZER
32 #define NS_DESIGNATED_INITIALIZER
33 #endif
34
35 typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) {
36 kRTCFileLoggerSeverityVerbose,
37 kRTCFileLoggerSeverityInfo,
38 kRTCFileLoggerSeverityWarning,
39 kRTCFileLoggerSeverityError
40 };
41
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
44 // reached logs from the beginning and the end are preserved while the middle
45 // section is overwritten instead.
46 // This class is not threadsafe.
47 @interface RTCFileLogger : NSObject
48
49 // The severity level to capture. The default is kRTCFileLoggerSeverityInfo.
50 @property(nonatomic, assign) RTCFileLoggerSeverity severity;
51
52 // Default constructor provides default settings for file path and file size.
53 - (instancetype)init;
54
55 - (instancetype)initWithFilePath:(NSString *)filePath
56 maxFileSize:(NSUInteger)maxFileSize
57 NS_DESIGNATED_INITIALIZER;
58
59 // Starts writing WebRTC logs to file if not already started. Overwrites any
60 // existing file.
61 - (void)start;
62
63 // Stops writing WebRTC logs to file. Rewrites the log file as required to
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;
67
68 // Returns the current contents of the log file. Returns nil if start has been
69 // called without a stop, or if there is no data.
70 - (NSData *)logData;
71
72 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698