88
99#import " ASLogLoadingOperation.h"
1010
11+ #import " BRLogger.h"
12+
1113#import " BRMacro.h"
1214#import " ASLogObservingOperation.h"
1315#import " BRBuildInfo.h"
@@ -52,7 +54,7 @@ - (void)start {
5254 NSError *fetchError;
5355 BRBuild *build = [self .storage buildWithSlug: self .buildSlug error: &fetchError];
5456 if (!build) {
55- NSLog ( @" ASLogLoadingOperation: failed to get build: %@ " , fetchError);
57+ BRLog (LL_WARN, LL_STORAGE, @" ASLogLoadingOperation: failed to get build: %@ " , fetchError);
5658 [self finish ];
5759 return ;
5860 }
@@ -83,7 +85,7 @@ - (void)finish {
8385}
8486
8587- (void )loadLogs : (BRBuild *)build {
86- NSLog ( @" ASLogLoadingOperation: fetching log: %@ " , self.buildSlug );
88+ BRLog (LL_DEBUG, LL_STORAGE, @" ASLogLoadingOperation: fetching log: %@ " , self.buildSlug );
8789 BRLogsRequest *request = [[BRLogsRequest alloc ] initWithToken: build.app.account.token
8890 appSlug: build.app.slug
8991 buildSlug: build.slug since: [build.log.timestamp timeIntervalSince1970 ]];
@@ -111,7 +113,7 @@ - (void)loadLogs:(BRBuild *)build {
111113
112114 // Clean pervious logs
113115 if (![self .storage cleanLogs: build error: &cleanError]) {
114- NSLog ( @" Failed to clean build logs: %@ " , cleanError);
116+ BRLog (LL_WARN, LL_STORAGE, @" Failed to clean build logs: %@ " , cleanError);
115117 [self finish ];
116118 return ;
117119 }
@@ -123,9 +125,9 @@ - (void)loadLogs:(BRBuild *)build {
123125 BOOL logMarked = [self .storage markBuildLog: build.log loaded: YES error: &markError];
124126
125127 if (metadataSaved && logSaved && logMarked) {
126- NSLog ( @" ASLogLoadingOperation: %@ - log saved" , self.buildSlug );
128+ BRLog (LL_DEBUG, LL_STORAGE, @" ASLogLoadingOperation: %@ - log saved" , self.buildSlug );
127129 } else {
128- NSLog ( @" ASLogLoadingOperation: Read log : %@ \n Save log : %@ \n Mark loaded: %@ " , readingError, saveError, markError);
130+ BRLog (LL_DEBUG, LL_STORAGE, @" ASLogLoadingOperation: Read log : %@ \n Save log : %@ \n Mark loaded: %@ " , readingError, saveError, markError);
129131 }
130132
131133 [self finish ];
@@ -144,7 +146,7 @@ - (NSURL *)moveLogFile:(NSURL *)tmpURL {
144146 targetURL = [targetURL URLByAppendingPathComponent: tmpURL.lastPathComponent];
145147 BOOL moveResult = [[NSFileManager defaultManager ] moveItemAtURL: tmpURL toURL: targetURL error: &moveError];
146148 if (!moveResult) {
147- NSLog ( @" Failed to move log file: %@ " , moveError);
149+ BRLog (LL_WARN, LL_STORAGE, @" Failed to move log file: %@ " , moveError);
148150 [super finish ];
149151 return nil ;
150152 }
0 commit comments