mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-08 01:51:09 +01:00
Added: Add Logger.logInfoAndShowToast() and log messages even if not showing toast due to null Context
This commit is contained in:
parent
9eeb2babd7
commit
2c0e9c6c5c
1 changed files with 13 additions and 4 deletions
|
|
@ -195,9 +195,20 @@ public class Logger {
|
|||
|
||||
|
||||
|
||||
public static void logErrorAndShowToast(Context context, String tag, String message) {
|
||||
if (context == null) return;
|
||||
public static void logInfoAndShowToast(Context context, String tag, String message) {
|
||||
if (CURRENT_LOG_LEVEL >= LOG_LEVEL_NORMAL) {
|
||||
logInfo(tag, message);
|
||||
showToast(context, message, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void logInfoAndShowToast(Context context, String message) {
|
||||
logInfoAndShowToast(context, DEFAULT_LOG_TAG, message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void logErrorAndShowToast(Context context, String tag, String message) {
|
||||
if (CURRENT_LOG_LEVEL >= LOG_LEVEL_NORMAL) {
|
||||
logError(tag, message);
|
||||
showToast(context, message, true);
|
||||
|
|
@ -211,8 +222,6 @@ public class Logger {
|
|||
|
||||
|
||||
public static void logDebugAndShowToast(Context context, String tag, String message) {
|
||||
if (context == null) return;
|
||||
|
||||
if (CURRENT_LOG_LEVEL >= LOG_LEVEL_DEBUG) {
|
||||
logDebug(tag, message);
|
||||
showToast(context, message, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue