TF-4136 refactor(logging): replace logError with logWarning for non-critical cases

This commit is contained in:
dab246
2026-01-02 12:18:38 +07:00
committed by Dat H. Pham
parent 73dcb6067c
commit a23d15a9ca
160 changed files with 382 additions and 360 deletions
@@ -37,7 +37,7 @@ extension StringExtension on String {
}
}
} catch (e) {
logError('StringExtension::firstLetterToUpperCase(): $e');
logWarning('StringExtension::firstLetterToUpperCase(): $e');
return '';
}
}
@@ -94,7 +94,7 @@ extension StringExtension on String {
return 0;
}
} catch (e) {
logError('StringExtension::_generateGradientColorIndex(): $e');
logWarning('StringExtension::_generateGradientColorIndex(): $e');
return 0;
}
}
@@ -26,7 +26,7 @@ extension URIExtension on Uri {
try {
return origin.isNotEmpty;
} catch (e) {
logError('URIExtension::hasOrigin:Exception = $e');
logWarning('URIExtension::hasOrigin:Exception = $e');
return false;
}
}
@@ -46,7 +46,7 @@ abstract class DomTransformer {
return null;
}
} catch (e) {
logError('DomTransformer::findImageUrlFromStyleTag:Exception: $e');
logWarning('DomTransformer::findImageUrlFromStyleTag:Exception: $e');
return null;
}
}
@@ -28,7 +28,7 @@ class AddLazyLoadingForBackgroundImageTransformer extends DomTransformer {
}
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -36,7 +36,7 @@ class BlockCodeTransformer extends DomTransformer {
''';
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -29,7 +29,7 @@ class BlockQuotedTransformer extends DomTransformer {
''';
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -27,7 +27,7 @@ class HideDraftSignatureTransformer extends DomTransformer {
signature.attributes['style'] = '$currentStyle; display: none;';
}
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -52,7 +52,7 @@ class ImageTransformer extends DomTransformer {
}
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
@@ -48,7 +48,7 @@ class NormalizeLineHeightInStyleTransformer extends DomTransformer {
}
}
} catch (e) {
logError('$runtimeType::process: Exception = $e');
logWarning('$runtimeType::process: Exception = $e');
}
}
}
@@ -23,7 +23,7 @@ class RemoveCollapsedSignatureButtonTransformer extends DomTransformer {
element.remove();
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -31,7 +31,7 @@ class RemoveLazyLoadingForBackgroundImageTransformer extends DomTransformer {
element.attributes.remove('lazy');
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -21,7 +21,7 @@ class RemoveLazyLoadingImageTransformer extends DomTransformer {
element.attributes.remove('loading');
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -26,7 +26,7 @@ class RemoveMaxWidthInImageStyleTransformer extends DomTransformer {
}
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -22,7 +22,7 @@ class RemoveStyleTagOutsideTransformer extends DomTransformer {
element.remove();
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -26,7 +26,7 @@ class SanitizeHyperLinkTagInHtmlTransformer extends DomTransformer {
_addNoReferrerForRelProperty(element);
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
@@ -23,7 +23,7 @@ class RemoveScriptTransformer extends DomTransformer {
scriptElement.remove();
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -23,7 +23,7 @@ class SignatureTransformer extends DomTransformer {
element.attributes['class'] = 'tmail-signature-blocked';
}));
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
}
}
}
@@ -56,7 +56,7 @@ class SanitizeAutolinkFilter {
log('SanitizeAutolinkFilter::process:htmlTextBuffer = $textSanitized');
return textSanitized;
} catch (e) {
logError('$runtimeType::process:Exception = $e');
logWarning('$runtimeType::process:Exception = $e');
return inputText;
}
}
@@ -24,7 +24,7 @@ class SanitizeUrl {
}
return originalUrl;
} catch (e) {
logError('SanitizeUrl::process:Exception = $e');
logWarning('SanitizeUrl::process:Exception = $e');
return inputText;
}
}
@@ -166,7 +166,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
_handleHyperLinkEvent(data['url']);
}
} catch (e) {
logError('$runtimeType::_handleMessageEvent:Exception = $e');
logWarning('$runtimeType::_handleMessageEvent:Exception = $e');
}
}
@@ -212,7 +212,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
}
}
} catch (e) {
logError('$runtimeType::_handleIframeOnScrollChangedListener:Exception = $e');
logWarning('$runtimeType::_handleIframeOnScrollChangedListener:Exception = $e');
}
}
@@ -309,7 +309,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
log('$runtimeType::_handleOnIFrameKeyboardEvent:📥 Shortcut pressed: $shortcut');
widget.onIFrameKeyboardShortcutAction?.call(shortcut);
} catch (e) {
logError('$runtimeType::_handleOnIFrameKeyboardEvent: Exception = $e');
logWarning('$runtimeType::_handleOnIFrameKeyboardEvent: Exception = $e');
}
}
@@ -323,7 +323,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
log('$runtimeType::_handleOnIFrameClickEvent: $data');
widget.onIFrameClickAction?.call();
} catch (e) {
logError('$runtimeType::_handleOnIFrameClickEvent: Exception = $e');
logWarning('$runtimeType::_handleOnIFrameClickEvent: Exception = $e');
}
}
@@ -354,7 +354,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
}
}
} catch (e) {
logError('$runtimeType::_handleOnIFrameLinkHoverEvent: Exception = $e');
logWarning('$runtimeType::_handleOnIFrameLinkHoverEvent: Exception = $e');
}
}
@@ -363,7 +363,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
log('$runtimeType::_handleOnIFrameLinkOutEvent: $data');
_tooltipOverlay?.hide();
} catch (e) {
logError('$runtimeType::_handleOnIFrameLinkOutEvent: Exception = $e');
logWarning('$runtimeType::_handleOnIFrameLinkOutEvent: Exception = $e');
}
}
@@ -411,7 +411,7 @@ class HtmlContentViewState extends State<HtmlContentViewer> with AutomaticKeepAl
try {
_webViewController.dispose();
} catch (e) {
logError('_HtmlContentViewState:dispose:_webViewController.dispose: $e');
logWarning('_HtmlContentViewState:dispose:_webViewController.dispose: $e');
}
} else {
_webViewController.dispose();
@@ -111,7 +111,7 @@ class QuickSearchSuggestionListState<T, P, R>
try {
return await widget.fetchRecentActionCallback?.call(queryString);
} catch (e) {
logError('SuggestionsListState::_getRecent:Exception = $e');
logWarning('SuggestionsListState::_getRecent:Exception = $e');
return null;
}
}
@@ -120,7 +120,7 @@ class QuickSearchSuggestionListState<T, P, R>
try {
return await widget.contactSuggestionCallback?.call(queryString);
} catch (e) {
logError('SuggestionsListState::_getListContact:Exception = $e');
logWarning('SuggestionsListState::_getListContact:Exception = $e');
return null;
}
}
@@ -129,7 +129,7 @@ class QuickSearchSuggestionListState<T, P, R>
try {
return await widget.suggestionsCallback?.call(queryString);
} catch (e) {
logError('SuggestionsListState::_getListSuggestion:Exception = $e');
logWarning('SuggestionsListState::_getListSuggestion:Exception = $e');
return null;
}
}