mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
A few more minor logging changes
This commit is contained in:
parent
0fa2d4e66c
commit
e787105961
@ -1648,7 +1648,7 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
|
|||||||
}
|
}
|
||||||
selectTab(currentTab);
|
selectTab(currentTab);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(TAG_KIWIX, " Kiwix sharedpreferences corrupted");
|
Log.w(TAG_KIWIX, "Kiwix shared preferences corrupted", e);
|
||||||
//TODO: Show to user
|
//TODO: Show to user
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1679,7 +1679,7 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (BuildConfig.IS_CUSTOM_APP) {
|
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();
|
String currentLocaleCode = Locale.getDefault().toString();
|
||||||
// Custom App recommends to start off a specific language
|
// 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);
|
openZimFile(new File(filePath), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG_KIWIX,
|
Log.d(TAG_KIWIX, "Kiwix normal start, no zimFile loaded last time -> display help page");
|
||||||
" Kiwix normal start, no zimFile loaded last time -> display help page");
|
|
||||||
showHelpPage();
|
showHelpPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1757,8 +1756,7 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
|
|||||||
saveTabStates();
|
saveTabStates();
|
||||||
refreshBookmarks();
|
refreshBookmarks();
|
||||||
|
|
||||||
Log.d(TAG_KIWIX,
|
Log.d(TAG_KIWIX, "onPause Save currentzimfile to preferences: " + ZimContentProvider.getZimFile());
|
||||||
"onPause Save currentzimfile to preferences:" + ZimContentProvider.getZimFile());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void webViewUrlLoading() {
|
@Override public void webViewUrlLoading() {
|
||||||
|
@ -50,6 +50,7 @@ public class KiwixWebViewClient extends WebViewClient {
|
|||||||
return true;
|
return true;
|
||||||
} else if (url.startsWith(ZimContentProvider.UI_URI.toString())) {
|
} else if (url.startsWith(ZimContentProvider.UI_URI.toString())) {
|
||||||
Log.e("KiwixWebViewClient", "UI Url " + url + " not supported.");
|
Log.e("KiwixWebViewClient", "UI Url " + url + " not supported.");
|
||||||
|
//TODO: Document this code - what's a UI_URL?
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ public class ZimContentProvider extends ContentProvider {
|
|||||||
|
|
||||||
public synchronized static String setZimFile(String fileName) {
|
public synchronized static String setZimFile(String fileName) {
|
||||||
if (!jniKiwix.loadZIM(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;
|
zimFileName = null;
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG_KIWIX, "Opening ZIM file " + fileName);
|
Log.i(TAG_KIWIX, "Opening ZIM file " + fileName);
|
||||||
@ -107,7 +107,7 @@ public class ZimContentProvider extends ContentProvider {
|
|||||||
/* Try to open the corresponding fulltext index */
|
/* Try to open the corresponding fulltext index */
|
||||||
String fullText = getFulltextIndexPath(fileName);
|
String fullText = getFulltextIndexPath(fileName);
|
||||||
if (!jniKiwix.loadFulltextIndex(fullText)) {
|
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;
|
return zimFileName;
|
||||||
@ -464,13 +464,13 @@ public class ZimContentProvider extends ContentProvider {
|
|||||||
Log.d(TAG_KIWIX, "reading " + articleZimUrl
|
Log.d(TAG_KIWIX, "reading " + articleZimUrl
|
||||||
+ "(mime: " + mime.value + ", size: " + size.value + ") finished.");
|
+ "(mime: " + mime.value + ", size: " + size.value + ") finished.");
|
||||||
} catch (IOException | NullPointerException e) {
|
} 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);
|
e);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
out.close();
|
out.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.w(TAG_KIWIX,
|
Log.e(TAG_KIWIX,
|
||||||
"Custom exception by closing out stream for article " + articleZimUrl,
|
"Custom exception by closing out stream for article " + articleZimUrl,
|
||||||
e);
|
e);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,8 @@ public class KiwixTextToSpeech {
|
|||||||
initialized = true;
|
initialized = true;
|
||||||
onInitSucceedListener.onInitSucceed();
|
onInitSucceedListener.onInitSucceed();
|
||||||
} else {
|
} 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
|
@Override
|
||||||
public void onError(String s) {
|
public void onError(String s) {
|
||||||
Log.w(TAG_KIWIX, "TextToSpeech Error: " + s);
|
Log.e(TAG_KIWIX, "TextToSpeech Error: " + s);
|
||||||
|
//TODO: Surface to user
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ public class LanguageUtils {
|
|||||||
field.setBoolean(layoutInflater, false);
|
field.setBoolean(layoutInflater, false);
|
||||||
layoutInflater.setFactory(new LayoutInflaterFactory(mContext, layoutInflater));
|
layoutInflater.setFactory(new LayoutInflaterFactory(mContext, layoutInflater));
|
||||||
} catch (NoSuchFieldException | IllegalAccessException | IllegalArgumentException e) {
|
} 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;
|
return view;
|
||||||
} catch (InflateException | ClassNotFoundException e) {
|
} catch (InflateException | ClassNotFoundException e) {
|
||||||
Log.w(TAG_KIWIX,
|
Log.w(TAG_KIWIX, "Could not apply the custom font to " + name, e);
|
||||||
"Could not apply the custom font to " + name + " " + e.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public class NetworkUtils {
|
|||||||
details = details.trim().replaceAll(" +", " ");
|
details = details.trim().replaceAll(" +", " ");
|
||||||
return details;
|
return details;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d(KiwixMobileActivity.TAG_KIWIX, "Context invalid url: " + url);
|
Log.d(KiwixMobileActivity.TAG_KIWIX, "Context invalid url: " + url, e);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user