A few more minor logging changes

This commit is contained in:
Joseph Reeve 2017-08-25 14:05:01 +01:00 committed by Julian Harty
parent 0fa2d4e66c
commit e787105961
7 changed files with 19 additions and 19 deletions

View File

@ -1648,7 +1648,7 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
}
selectTab(currentTab);
} catch (Exception e) {
Log.w(TAG_KIWIX, " Kiwix sharedpreferences corrupted");
Log.w(TAG_KIWIX, "Kiwix shared preferences corrupted", e);
//TODO: Show to user
}
}
@ -1679,7 +1679,7 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
} else {
if (BuildConfig.IS_CUSTOM_APP) {
Log.d(TAG_KIWIX, "Kiwix Custom App starting for the first time. Check Companion ZIM: " + BuildConfig.ZIM_FILE_NAME);
Log.d(TAG_KIWIX, "Kiwix Custom App starting for the first time. Checking Companion ZIM: " + BuildConfig.ZIM_FILE_NAME);
String currentLocaleCode = Locale.getDefault().toString();
// Custom App recommends to start off a specific language
@ -1742,8 +1742,7 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
openZimFile(new File(filePath), true);
}
} else {
Log.d(TAG_KIWIX,
" Kiwix normal start, no zimFile loaded last time -> display help page");
Log.d(TAG_KIWIX, "Kiwix normal start, no zimFile loaded last time -> display help page");
showHelpPage();
}
}
@ -1757,8 +1756,7 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
saveTabStates();
refreshBookmarks();
Log.d(TAG_KIWIX,
"onPause Save currentzimfile to preferences:" + ZimContentProvider.getZimFile());
Log.d(TAG_KIWIX, "onPause Save currentzimfile to preferences: " + ZimContentProvider.getZimFile());
}
@Override public void webViewUrlLoading() {

View File

@ -50,6 +50,7 @@ public class KiwixWebViewClient extends WebViewClient {
return true;
} else if (url.startsWith(ZimContentProvider.UI_URI.toString())) {
Log.e("KiwixWebViewClient", "UI Url " + url + " not supported.");
//TODO: Document this code - what's a UI_URL?
return true;
}

View File

@ -98,7 +98,7 @@ public class ZimContentProvider extends ContentProvider {
public synchronized static String setZimFile(String fileName) {
if (!jniKiwix.loadZIM(fileName)) {
Log.w(TAG_KIWIX, "Unable to open the ZIM file " + fileName);
Log.e(TAG_KIWIX, "Unable to open the ZIM file " + fileName);
zimFileName = null;
} else {
Log.i(TAG_KIWIX, "Opening ZIM file " + fileName);
@ -107,7 +107,7 @@ public class ZimContentProvider extends ContentProvider {
/* Try to open the corresponding fulltext index */
String fullText = getFulltextIndexPath(fileName);
if (!jniKiwix.loadFulltextIndex(fullText)) {
Log.w(TAG_KIWIX, "Unable to open the ZIM fulltext index " + fullText);
Log.e(TAG_KIWIX, "Unable to open the ZIM fulltext index " + fullText);
}
}
return zimFileName;
@ -464,13 +464,13 @@ public class ZimContentProvider extends ContentProvider {
Log.d(TAG_KIWIX, "reading " + articleZimUrl
+ "(mime: " + mime.value + ", size: " + size.value + ") finished.");
} catch (IOException | NullPointerException e) {
Log.w(TAG_KIWIX, "Exception reading article " + articleZimUrl + " from zim file",
Log.e(TAG_KIWIX, "Exception reading article " + articleZimUrl + " from zim file",
e);
} finally {
try {
out.close();
} catch (IOException e) {
Log.w(TAG_KIWIX,
Log.e(TAG_KIWIX,
"Custom exception by closing out stream for article " + articleZimUrl,
e);
}

View File

@ -60,7 +60,8 @@ public class KiwixTextToSpeech {
initialized = true;
onInitSucceedListener.onInitSucceed();
} else {
Log.w(TAG_KIWIX, "Initilization of TextToSpeech Failed!");
Log.e(TAG_KIWIX, "Initialization of TextToSpeech Failed!");
//TODO: Surface to user
}
});
}
@ -249,7 +250,8 @@ public class KiwixTextToSpeech {
@Override
public void onError(String s) {
Log.w(TAG_KIWIX, "TextToSpeech Error: " + s);
Log.e(TAG_KIWIX, "TextToSpeech Error: " + s);
//TODO: Surface to user
}
});
}

View File

@ -195,7 +195,7 @@ public class LanguageUtils {
field.setBoolean(layoutInflater, false);
layoutInflater.setFactory(new LayoutInflaterFactory(mContext, layoutInflater));
} catch (NoSuchFieldException | IllegalAccessException | IllegalArgumentException e) {
Log.w(TAG_KIWIX, "could not access private field of the LayoutInflater");
Log.w(TAG_KIWIX, "Font Change Failed: Could not access private field of the LayoutInflater", e);
}
}
@ -264,8 +264,7 @@ public class LanguageUtils {
return view;
} catch (InflateException | ClassNotFoundException e) {
Log.w(TAG_KIWIX,
"Could not apply the custom font to " + name + " " + e.getMessage());
Log.w(TAG_KIWIX, "Could not apply the custom font to " + name, e);
}
}

View File

@ -77,7 +77,7 @@ public class NetworkUtils {
details = details.trim().replaceAll(" +", " ");
return details;
} catch (Exception e) {
Log.d(KiwixMobileActivity.TAG_KIWIX, "Context invalid url: " + url);
Log.d(KiwixMobileActivity.TAG_KIWIX, "Context invalid url: " + url, e);
return "";
}
}