Skip to content

Commit

Permalink
chore: add logger without timestamps for some testing cases
Browse files Browse the repository at this point in the history
  • Loading branch information
pankcuf committed Nov 7, 2023
1 parent 9308e62 commit 64132d4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DashSync/shared/Libraries/DSLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@

NS_ASSUME_NONNULL_BEGIN

@interface NoTimestampLogFormatter : NSObject <DDLogFormatter>
@end
@implementation NoTimestampLogFormatter
- (nullable NSString *)formatLogMessage:(DDLogMessage *)logMessage {
return logMessage.message;
}
@end

@interface DSLogger ()

@property (readonly, nonatomic, strong) DDFileLogger *fileLogger;
Expand All @@ -44,6 +52,8 @@ - (instancetype)init {
DDFileLogger *fileLogger = [[DDFileLogger alloc] init];
fileLogger.rollingFrequency = 60 * 60 * 24; // 24 hour rolling
fileLogger.logFileManager.maximumNumberOfLogFiles = 3; // keep a 3 days worth of log files
[fileLogger setLogFormatter:[[NoTimestampLogFormatter alloc] init]]; // Use the custom formatter

[DDLog addLogger:fileLogger];
_fileLogger = fileLogger;
}
Expand Down

0 comments on commit 64132d4

Please sign in to comment.