Class Logger
-
- All Implemented Interfaces:
public final class Logger
Logger that will log to both logcat and Discord's debug log
-
-
Method Summary
Modifier and Type Method Description final String
getModule()
final Unit
setModule(String module)
final Unit
verbose(String msg)
Logs a Log.VERBOSE message final Unit
debug(String msg)
Logs a Log.DEBUG message final Unit
info(String msg, Throwable throwable)
Logs a Log.INFO message and prints the stacktrace of the exception final Unit
info(String msg)
Logs a Log.INFO message and prints the stacktrace of the exception final Unit
info(Context ctx, String msg)
Logs a Log.INFO message, and shows it to the user as a toast final Unit
infoToast(String msg)
Logs a Log.INFO message, and shows it to the user as a toast final Unit
warn(String msg, Throwable throwable)
Logs a Log.WARN message and prints the stacktrace of the exception final Unit
warn(String msg)
Logs a Log.WARN message and prints the stacktrace of the exception final Unit
error(Throwable throwable)
Logs an exception final Unit
error(String msg, Throwable throwable)
Logs a Log.ERROR message and prints the stacktrace of the exception final Unit
error(Context ctx, Throwable throwable)
Logs an exception and shows the user a toast saying "Sorry, something went wrong. final Unit
errorToast(Throwable throwable)
Logs an exception and shows the user a toast saying "Sorry, something went wrong. final Unit
errorToast(String msg, Throwable throwable)
Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception final Unit
errorToast(String msg)
Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception final Unit
errorToast(Context ctx, String msg, Throwable throwable)
Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception final Unit
errorToast(Context ctx, String msg)
Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception -
-
Constructor Detail
-
Logger
Logger(String module)
- Parameters:
module
- Name of the module
-
-
Method Detail
-
verbose
final Unit verbose(String msg)
Logs a Log.VERBOSE message
- Parameters:
msg
- Message to log
-
info
final Unit info(String msg, Throwable throwable)
Logs a Log.INFO message and prints the stacktrace of the exception
- Parameters:
msg
- Message to logthrowable
- Exception to log
-
info
final Unit info(String msg)
Logs a Log.INFO message and prints the stacktrace of the exception
- Parameters:
msg
- Message to log
-
info
final Unit info(Context ctx, String msg)
Logs a Log.INFO message, and shows it to the user as a toast
- Parameters:
msg
- Message to log
-
infoToast
final Unit infoToast(String msg)
Logs a Log.INFO message, and shows it to the user as a toast
- Parameters:
msg
- Message to log
-
warn
final Unit warn(String msg, Throwable throwable)
Logs a Log.WARN message and prints the stacktrace of the exception
- Parameters:
msg
- Message to logthrowable
- Exception to log
-
warn
final Unit warn(String msg)
Logs a Log.WARN message and prints the stacktrace of the exception
- Parameters:
msg
- Message to log
-
error
final Unit error(Throwable throwable)
Logs an exception
- Parameters:
throwable
- Exception to log
-
error
final Unit error(String msg, Throwable throwable)
Logs a Log.ERROR message and prints the stacktrace of the exception
- Parameters:
msg
- Message to logthrowable
- Exception to log
-
error
final Unit error(Context ctx, Throwable throwable)
Logs an exception and shows the user a toast saying "Sorry, something went wrong. Please try again."
- Parameters:
throwable
- Exception to log
-
errorToast
final Unit errorToast(Throwable throwable)
Logs an exception and shows the user a toast saying "Sorry, something went wrong. Please try again."
- Parameters:
throwable
- Exception to log
-
errorToast
final Unit errorToast(String msg, Throwable throwable)
Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception
- Parameters:
msg
- Message to logthrowable
- Exception to log
-
errorToast
final Unit errorToast(String msg)
Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception
- Parameters:
msg
- Message to log
-
errorToast
final Unit errorToast(Context ctx, String msg, Throwable throwable)
Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception
- Parameters:
msg
- Message to logthrowable
- Exception to log
-
errorToast
final Unit errorToast(Context ctx, String msg)
Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception
- Parameters:
msg
- Message to log
-
-
-
-