Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Unified Diff: base/android/java/src/org/chromium/base/ApkAssets.java

Issue 1921573002: Suppress logspam arising from trying to register/load v8 blobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/ApkAssets.java
diff --git a/base/android/java/src/org/chromium/base/ApkAssets.java b/base/android/java/src/org/chromium/base/ApkAssets.java
index e00be9924b4e0da679581549f83feab7663063c5..f3c89f30e06200bad2e4f3c63ffe3d3d7a4fc56e 100644
--- a/base/android/java/src/org/chromium/base/ApkAssets.java
+++ b/base/android/java/src/org/chromium/base/ApkAssets.java
@@ -33,7 +33,19 @@ public class ApkAssets {
afd.getStartOffset(),
afd.getLength() };
} catch (IOException e) {
- Log.e(LOGTAG, "Error while loading asset " + fileName + ": " + e);
+ // As a general rule there's no point logging here because the caller should handle
+ // receiving an fd of -1 sensibly, and the log message is either mirrored later, or
+ // unwanted (in the case where a missing file is expected), or wanted but will be
+ // ignored, as most non-fatal logs are.
+ // It makes sense to log here when the file exists, but is unable to be opened as an fd
+ // because (for example) it is unexpectedly compressed in an apk. In that case, the log
+ // message might save someone some time working out what has gone wrong.
+ // For that reason, we only suppress the message when the exception message doesn't look
+ // informative (Android framework passes the filename as the message on actual file not
+ // found, and the empty string also wouldn't give any useful information for debugging).
+ if (!e.getMessage().equals("") && !e.getMessage().equals(fileName)) {
+ Log.e(LOGTAG, "Error while loading asset " + fileName + ": " + e);
+ }
return new long[] {-1, -1, -1};
} finally {
try {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698