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

Unified Diff: talk/app/webrtc/objc/public/RTCFileLogger.h

Issue 1432753003: Add oldest rotation type option to RTCFileLogger (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add whitespace Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/objc/public/RTCFileLogger.h
diff --git a/talk/app/webrtc/objc/public/RTCFileLogger.h b/talk/app/webrtc/objc/public/RTCFileLogger.h
index 3900cb6fbeb5199913be877f246b3677ba1c6aae..95155f2def227bffc0e175184d8bd6b0de3b0557 100644
--- a/talk/app/webrtc/objc/public/RTCFileLogger.h
+++ b/talk/app/webrtc/objc/public/RTCFileLogger.h
@@ -39,21 +39,38 @@ typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) {
kRTCFileLoggerSeverityError
};
+typedef NS_ENUM(NSUInteger, RTCFileLoggerRotationType) {
+ kRTCFileLoggerRotationTypeMiddle,
tkchin_webrtc 2015/11/16 21:37:25 suggest FileLoggerType kRTCFileLoggerTypeCall kRTC
Chuck 2015/12/04 22:42:57 Done.
+ kRTCFileLoggerRotationTypeOldest,
+};
+
// This class intercepts WebRTC logs and saves them to a file. The file size
// will not exceed the given maximum bytesize. When the maximum bytesize is
-// reached logs from the beginning and the end are preserved while the middle
-// section is overwritten instead.
+// reached, logs are rotated according to the rotationType specified.
+// For kRTCFileLoggerRotationTypeMiddle, logs from the beginning and the end
+// are preserved while the middle section is overwritten instead.
+// For kRTCFileLoggerRotationTypeOldest, the oldest log is overwritten.
// This class is not threadsafe.
@interface RTCFileLogger : NSObject
// The severity level to capture. The default is kRTCFileLoggerSeverityInfo.
@property(nonatomic, assign) RTCFileLoggerSeverity severity;
-// Default constructor provides default settings for dir path and file size.
+// The rotation type for this file logger. The default is
+// kRTCFileLoggerRotationTypeMiddle.
+@property(nonatomic, readonly) RTCFileLoggerRotationType rotationType;
+
+// Default constructor provides default settings for dir path, file size and
+// rotation type.
- (instancetype)init;
+// Create file logger with default rotation type.
+- (instancetype)initWithDirPath:(NSString *)dirPath
+ maxFileSize:(NSUInteger)maxFileSize;
+
- (instancetype)initWithDirPath:(NSString *)dirPath
maxFileSize:(NSUInteger)maxFileSize
+ rotationType:(RTCFileLoggerRotationType)rotationType
NS_DESIGNATED_INITIALIZER;
// Starts writing WebRTC logs to disk if not already started. Overwrites any

Powered by Google App Engine
This is Rietveld 408576698