diff --git a/baRSS/Feed Import/Download3rdParty.h b/baRSS/Feed Import/Download3rdParty.h index 06746a2..ba3248d 100644 --- a/baRSS/Feed Import/Download3rdParty.h +++ b/baRSS/Feed Import/Download3rdParty.h @@ -22,6 +22,8 @@ @import Cocoa; +#define ENV_LOG_YOUTUBE 1 + // TODO: Make plugins extensible? community extensions. @interface YouTubePlugin : NSObject + (NSString*)feedURL:(NSURL*)url; diff --git a/baRSS/Feed Import/Download3rdParty.m b/baRSS/Feed Import/Download3rdParty.m index 81820a7..0537d07 100644 --- a/baRSS/Feed Import/Download3rdParty.m +++ b/baRSS/Feed Import/Download3rdParty.m @@ -39,7 +39,7 @@ // https://www.youtube.com/channel/[channel-id] // https://www.youtube.com/user/[user-name] // https://www.youtube.com/playlist?list=[playlist-id] -#ifdef DEBUG +#if DEBUG && ENV_LOG_YOUTUBE printf("resolving YouTube url:\n"); printf(" ↳ %s\n", url.absoluteString.UTF8String); #endif @@ -64,7 +64,7 @@ } } } -#ifdef DEBUG +#if DEBUG && ENV_LOG_YOUTUBE printf(" ↳ %s\n", found ? found.UTF8String : "could not resolve!"); #endif return found; // may be nil diff --git a/baRSS/Feed Import/FaviconDownload.m b/baRSS/Feed Import/FaviconDownload.m index c3ceb72..083f671 100644 --- a/baRSS/Feed Import/FaviconDownload.m +++ b/baRSS/Feed Import/FaviconDownload.m @@ -168,7 +168,7 @@ NSURL *path = self.fileURL; NSImage *img = [[NSImage alloc] initByReferencingURL:path]; if (!img.valid) { path = nil; img = nil; } -#ifdef DEBUG +#if DEBUG && ENV_LOG_DOWNLOAD printf("ICON %1.0fx%1.0f %s\n", img.size.width, img.size.height, self.remoteURL.absoluteString.UTF8String); printf(" ↳ %s\n", path.absoluteString.UTF8String); #endif diff --git a/baRSS/Info.plist b/baRSS/Info.plist index 1bc3cef..fc997f9 100644 --- a/baRSS/Info.plist +++ b/baRSS/Info.plist @@ -70,7 +70,7 @@ CFBundleVersion - 13702 + 13723 LSApplicationCategoryType public.app-category.news LSMinimumSystemVersion diff --git a/baRSS/NSCategories/NSURL+Ext.h b/baRSS/NSCategories/NSURL+Ext.h index b94525c..cae5845 100644 --- a/baRSS/NSCategories/NSURL+Ext.h +++ b/baRSS/NSCategories/NSURL+Ext.h @@ -22,6 +22,8 @@ @import Cocoa; +#define ENV_LOG_FILES 0 + @interface NSURL (Ext) // Generators + (NSURL*)applicationSupportURL; diff --git a/baRSS/NSCategories/NSURL+Ext.m b/baRSS/NSCategories/NSURL+Ext.m index 7a45bb8..526b054 100644 --- a/baRSS/NSCategories/NSURL+Ext.m +++ b/baRSS/NSCategories/NSURL+Ext.m @@ -89,11 +89,11 @@ /// Delete file or folder at URL. If item does not exist, this method does nothing. - (void)remove { -#ifdef DEBUG +#if DEBUG && ENV_LOG_FILES BOOL success = #endif [[NSFileManager defaultManager] removeItemAtURL:self error:nil]; -#ifdef DEBUG +#if DEBUG && ENV_LOG_FILES if (success) printf("DEL %s\n", self.absoluteString.UTF8String); #endif } @@ -102,7 +102,7 @@ - (void)moveTo:(NSURL*)destination { [[NSFileManager defaultManager] removeItemAtURL:destination error:nil]; [[NSFileManager defaultManager] moveItemAtURL:self toURL:destination error:nil]; -#ifdef DEBUG +#if DEBUG && ENV_LOG_FILES printf("MOVE %s\n", self.absoluteString.UTF8String); printf(" ↳ %s\n", destination.absoluteString.UTF8String); #endif diff --git a/baRSS/NSCategories/NSURLRequest+Ext.h b/baRSS/NSCategories/NSURLRequest+Ext.h index b5509a3..35f9bf3 100644 --- a/baRSS/NSCategories/NSURLRequest+Ext.h +++ b/baRSS/NSCategories/NSURLRequest+Ext.h @@ -22,6 +22,8 @@ @import Cocoa; +#define ENV_LOG_DOWNLOAD 1 + @interface NSURLRequest (Ext) + (instancetype)withURL:(NSString*)urlStr; - (NSURLSessionDataTask*)dataTask:(nonnull void(^)(NSData * _Nullable data, NSError * _Nullable error, NSHTTPURLResponse *response))block; diff --git a/baRSS/NSCategories/NSURLRequest+Ext.m b/baRSS/NSCategories/NSURLRequest+Ext.m index 6e4dd6a..500b1c4 100644 --- a/baRSS/NSCategories/NSURLRequest+Ext.m +++ b/baRSS/NSCategories/NSURLRequest+Ext.m @@ -58,7 +58,7 @@ static NSURLSession* NonCachingURLSession(void) { NSURLSessionDataTask *task = [NonCachingURLSession() dataTaskWithRequest:self completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response; NSInteger status = [httpResponse statusCode]; -#ifdef DEBUG +#if DEBUG && ENV_LOG_DOWNLOAD /*if (status != 304)*/ printf("GET %ld %s\n", status, self.URL.absoluteString.UTF8String); #endif if (error || status == 304) {