diff --git a/Easydict/objc/MMKit/Kit/MMOrderedDictionary.m b/Easydict/objc/MMKit/Kit/MMOrderedDictionary.m index 377c6c147..7bb8f6cd4 100644 --- a/Easydict/objc/MMKit/Kit/MMOrderedDictionary.m +++ b/Easydict/objc/MMKit/Kit/MMOrderedDictionary.m @@ -110,7 +110,7 @@ - (id)mutableCopyWithZone:(NSZone *)zone { - (id)copy { NSString *reason = [NSString stringWithFormat:@"-[%@ %@] not supported, please use mutableCopy!", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; - MMLogWarn(@"%@", reason); + MMLogError(@"%@", reason); @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:reason userInfo:nil]; diff --git a/Easydict/objc/Service/Apple/AppleDictionary/EZAppleDictionary.m b/Easydict/objc/Service/Apple/AppleDictionary/EZAppleDictionary.m index 1a319ad0f..a9b91a1b4 100644 --- a/Easydict/objc/Service/Apple/AppleDictionary/EZAppleDictionary.m +++ b/Easydict/objc/Service/Apple/AppleDictionary/EZAppleDictionary.m @@ -101,7 +101,7 @@ - (void)detectText:(NSString *)text completion:(nonnull void (^)(EZLanguage, NSE } - (void)ocr:(EZQueryModel *)queryModel completion:(void (^)(EZOCRResult *_Nullable, NSError *_Nullable))completion { - MMLogWarn(@"Apple Dictionary does not support ocr"); + MMLogError(@"Apple Dictionary does not support ocr"); } - (BOOL)queryDictionaryForText:(NSString *)text language:(EZLanguage)language { diff --git a/Easydict/objc/Service/AudioPlayer/EZAudioPlayer.m b/Easydict/objc/Service/AudioPlayer/EZAudioPlayer.m index 6c1355bbd..641365701 100644 --- a/Easydict/objc/Service/AudioPlayer/EZAudioPlayer.m +++ b/Easydict/objc/Service/AudioPlayer/EZAudioPlayer.m @@ -427,7 +427,7 @@ - (BOOL)canPlayLocalAudioFileAtPath:(NSString *)filePath { if (!asset.readable || !asset.isPlayable) { // change go.mp3 to go.m4a will cause asset not readable - MMLogWarn(@"asset not readable or playable: %@", filePath); + MMLogError(@"asset not readable or playable: %@", filePath); return NO; } @@ -697,7 +697,7 @@ - (nullable NSString *)tryCorrectAudioFileTypeWithPath:(NSString *)filePath { MMLogInfo(@"rename successful: %@", newFilePath); return newFilePath; } else { - MMLogWarn(@"rename failed: %@", [error localizedDescription]); + MMLogError(@"rename failed: %@", [error localizedDescription]); return nil; } } @@ -738,7 +738,7 @@ - (BOOL)isAudioFilePlayable:(NSURL *)filePathURL { return NO; } } else { - MMLogWarn(@"Error opening audio file type: %d", (int)status); + MMLogError(@"Error opening audio file type: %d", (int)status); return NO; } return YES; @@ -776,7 +776,7 @@ - (BOOL)isAudioFilePlayable:(NSURL *)filePathURL { id plistData = [NSPropertyListSerialization propertyListWithData:itemWhereFroms options:NSPropertyListImmutable format:&format error:&plistError]; if (plistError) { - MMLogWarn(@"Error decoding property list: %@", plistError); + MMLogError(@"Error decoding property list: %@", plistError); return nil; } diff --git a/Easydict/objc/Service/DeepL/EZDeepLTranslate.m b/Easydict/objc/Service/DeepL/EZDeepLTranslate.m index e98d2817a..666a363c5 100644 --- a/Easydict/objc/Service/DeepL/EZDeepLTranslate.m +++ b/Easydict/objc/Service/DeepL/EZDeepLTranslate.m @@ -145,7 +145,7 @@ - (void)translate:(NSString *)text from:(EZLanguage)from to:(EZLanguage)to compl } - (void)ocr:(EZQueryModel *)queryModel completion:(void (^)(EZOCRResult *_Nullable, NSError *_Nullable))completion { - MMLogWarn(@"deepL not support ocr"); + MMLogError(@"deepL not support ocr"); } - (BOOL)autoConvertTraditionalChinese { diff --git a/Easydict/objc/Service/WebViewTranslator/EZWebViewTranslator.m b/Easydict/objc/Service/WebViewTranslator/EZWebViewTranslator.m index d00ba8282..7abcadfeb 100644 --- a/Easydict/objc/Service/WebViewTranslator/EZWebViewTranslator.m +++ b/Easydict/objc/Service/WebViewTranslator/EZWebViewTranslator.m @@ -140,7 +140,7 @@ - (void)queryTranslateURL:(NSString *)URL // MMLog(@"queryTranslateURL: %@", URL); [self loadURL:URL]; - CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); +// CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent(); if (URL.length && completionHandler) { mm_weakify(self); @@ -152,7 +152,7 @@ - (void)queryTranslateURL:(NSString *)URL completionHandler(nil, error); } else { completionHandler(texts, nil); - CFAbsoluteTime endTime = CFAbsoluteTimeGetCurrent(); +// CFAbsoluteTime endTime = CFAbsoluteTimeGetCurrent(); // MMLog(@"webView cost: %.1f ms, URL: %@", (endTime - startTime) * 1000, URL); // cost ~2s } [self resetWebView]; @@ -229,7 +229,7 @@ - (void)getTextContentOfElement:(NSString *)selector [self getTextContentOfElement:selector completion:completion]; }); } else { - MMLogWarn(@"fail, max retry count: %ld", self.retryCount); + MMLogError(@"fail, max retry count: %ld", self.retryCount); if (completion) { completion(nil, [EZError timeoutError]); } diff --git a/Easydict/objc/Snip/Snip.m b/Easydict/objc/Snip/Snip.m index 404f3aa64..5460abe0a 100644 --- a/Easydict/objc/Snip/Snip.m +++ b/Easydict/objc/Snip/Snip.m @@ -70,7 +70,7 @@ - (MMEventMonitor *)rightMouseDownMonitor { - (void)startWithCompletion:(void (^)(NSImage *_Nullable))completion { BOOL enableRecord = [self checkRecordPermission]; if (!enableRecord) { - MMLogWarn(@"disabled record permission"); + MMLogError(@"disabled record permission"); completion(nil); return; } diff --git a/Easydict/objc/Utility/EZAudioUtils/EZAudioUtils.m b/Easydict/objc/Utility/EZAudioUtils/EZAudioUtils.m index 1506cd1f7..98e60c35f 100644 --- a/Easydict/objc/Utility/EZAudioUtils/EZAudioUtils.m +++ b/Easydict/objc/Utility/EZAudioUtils/EZAudioUtils.m @@ -87,7 +87,7 @@ + (void)getPlayingSongInfo { // Get a C function pointer for MRMediaRemoteGetNowPlayingInfo void *mrMediaRemoteGetNowPlayingInfoPointer = CFBundleGetFunctionPointerForName(mediaRemoteBundle, CFSTR("MRMediaRemoteGetNowPlayingInfo")); if (!mrMediaRemoteGetNowPlayingInfoPointer) { - MMLogWarn(@"Failed to get MRMediaRemoteGetNowPlayingInfo function pointer"); + MMLogError(@"Failed to get MRMediaRemoteGetNowPlayingInfo function pointer"); CFRelease(mediaRemoteBundle); } typedef void (*MRMediaRemoteGetNowPlayingInfoFunction)(dispatch_queue_t queue, void (^completionHandler)(NSDictionary *information)); @@ -96,7 +96,7 @@ + (void)getPlayingSongInfo { // Get a C function pointer for MRNowPlayingClientGetBundleIdentifier void *mrNowPlayingClientGetBundleIdentifierPointer = CFBundleGetFunctionPointerForName(mediaRemoteBundle, CFSTR("MRNowPlayingClientGetBundleIdentifier")); if (!mrNowPlayingClientGetBundleIdentifierPointer) { - MMLogWarn(@"Failed to get MRNowPlayingClientGetBundleIdentifier function pointer"); + MMLogError(@"Failed to get MRNowPlayingClientGetBundleIdentifier function pointer"); CFRelease(mediaRemoteBundle); }