Class Logger
-
- All Implemented Interfaces:
public final class LoggerLogger that will log to both logcat and Discord's debug log
-
-
Method Summary
Modifier and Type Method Description final StringgetModule()final UnitsetModule(String value)final Unitverbose(String msg)Logs a Log.VERBOSE message final Unitdebug(String msg)Logs a Log.DEBUG message final Unitinfo(String msg, Throwable throwable)Logs a Log.INFO message and prints the stacktrace of the exception final Unitinfo(String msg)Logs a Log.INFO message and prints the stacktrace of the exception final Unitinfo(Context ctx, String msg)Logs a Log.INFO message, and shows it to the user as a toast final UnitinfoToast(String msg)Logs a Log.INFO message, and shows it to the user as a toast final Unitwarn(String msg, Throwable throwable)Logs a Log.WARN message and prints the stacktrace of the exception final Unitwarn(String msg)Logs a Log.WARN message and prints the stacktrace of the exception final Uniterror(Throwable throwable)Logs an exception final Uniterror(String msg, Throwable throwable)Logs a Log.ERROR message and prints the stacktrace of the exception final Uniterror(Context ctx, Throwable throwable)Logs an exception and shows the user a toast saying "Sorry, something went wrong. final UniterrorToast(Throwable throwable)Logs an exception and shows the user a toast saying "Sorry, something went wrong. final UniterrorToast(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 UniterrorToast(String msg)Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception final UniterrorToast(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 UniterrorToast(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
@JvmOverloads() 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
@JvmOverloads() final Unit info(String msg)
Logs a Log.INFO message and prints the stacktrace of the exception
- Parameters:
msg- Message to log
-
info
@Deprecated(message = "Use infoToast(msg) instead", replaceWith = @ReplaceWith(expression = "infoToast(msg)")) 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
@JvmOverloads() 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
@JvmOverloads() 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
@Deprecated(message = "Use errorToast(throwable) instead", replaceWith = @ReplaceWith(expression = "errorToast(throwable)")) 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
@JvmOverloads() 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
@JvmOverloads() 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
@JvmOverloads()@Deprecated(message = "Use errorToast(msg, throwable) instead", replaceWith = @ReplaceWith(expression = "errorToast(msg, throwable)")) 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
@JvmOverloads()@Deprecated(message = "Use errorToast(msg, throwable) instead", replaceWith = @ReplaceWith(expression = "errorToast(msg, throwable)")) 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
-
-
-
-