Skip to content

Commit 7e15058

Browse files
committed
The compiler option to log running of operations in SSYOperation now uses SSYLinearFileWriter instead of a class which is private to my own projects.
1 parent 6c6f6f9 commit 7e15058

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

SSYOperation.m

+19-11
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66

77
#if DEBUG
88
#if 0
9-
#warning Logging SSYOperationLinker Operations. DO NOT SHIP THIS!
10-
#define LOGGING_SSYOPERATIONLINKER_OPERATIONS 1
11-
#import "BkmxBasis.h"
9+
#warning Logging running of operations in SSYOperation. DO NOT SHIP THIS!
10+
/* For this to work, you must set the file path of the singleton
11+
SSYLinearFileWriter object before beginning operations. */
12+
#define LOG_RUNNING_OF_OPERATIONS 1
13+
#import "SSYLinearFileWriter.h"
1214
#endif
1315
#endif
1416

@@ -226,7 +228,7 @@ - (BOOL)lockIsBlocking {
226228

227229
- (void)main {
228230
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init] ;
229-
#if LOGGING_SSYOPERATIONLINKER_OPERATIONS
231+
#if LOG_RUNNING_OF_OPERATIONS
230232
NSString* msg = [NSString stringWithFormat:
231233
@"RunOp: %p grp=%@ prevErr=%ld nQ=%ld sel=%@ isCnc=%hhd",
232234
self,
@@ -235,7 +237,7 @@ - (void)main {
235237
(long)[[[self operationQueue] operations] count], // nQ = number in queue
236238
NSStringFromSelector([self selector]),
237239
[self isCancelled]];
238-
[[BkmxBasis sharedBasis] logFormat:msg];
240+
[SSYLinearFileWriter writeLine:msg];
239241
#endif
240242

241243
if (![self isCancelled]) {
@@ -265,20 +267,26 @@ - (void)main {
265267
else {
266268
// Chain operations have been aborted.
267269
// This method becomes a no-op.
268-
#if LOGGING_SSYOPERATIONLINKER_OPERATIONS
269-
[[BkmxBasis sharedBasis] logFormat:@"RunOp: Skipping %@ cuz error op=%p", NSStringFromSelector([self selector]), self];
270+
#if LOG_RUNNING_OF_OPERATIONS
271+
NSString* msg = [[NSString alloc] initWithFormat:@"RunOp: Skipping %@ cuz error op=%p", NSStringFromSelector([self selector]), self];
272+
[SSYLinearFileWriter writeLine:msg];
273+
[msg release];
270274
#endif
271275
}
272276
}
273277
else {
274-
#if LOGGING_SSYOPERATIONLINKER_OPERATIONS
275-
[[BkmxBasis sharedBasis] logFormat:@"RunOp: Skipping %@ cuz skip group %@ op=%p", NSStringFromSelector([self selector]), [[self info] objectForKey:constKeySSYOperationGroup], self];
278+
#if LOG_RUNNING_OF_OPERATIONS
279+
NSString* msg = [[NSString alloc] initWithFormat:@"RunOp: Skipping %@ cuz skip group %@ op=%p", NSStringFromSelector([self selector]), [[self info] objectForKey:constKeySSYOperationGroup], self];
280+
[SSYLinearFileWriter writeLine:msg];
281+
[msg release];
276282
#endif
277283
}
278284
}
279285
else {
280-
#if LOGGING_SSYOPERATIONLINKER_OPERATIONS
281-
[[BkmxBasis sharedBasis] logFormat:@"RunOp: Skipping %@ cuz cancelled op=%p", NSStringFromSelector([self selector]), self];
286+
#if LOG_RUNNING_OF_OPERATIONS
287+
NSString* msg = [[NSString alloc] initWithFormat:@"RunOp: Skipping %@ cuz cancelled op=%p", NSStringFromSelector([self selector]), self];
288+
[SSYLinearFileWriter writeLine:msg];
289+
[msg release];
282290
#endif
283291
}
284292

0 commit comments

Comments
 (0)