Logger

class Logger(var module: String = "Aliucord")

Logger that will log to both logcat and Discord's debug log

Parameters

module

Name of the module

Constructors

Link copied to clipboard
constructor(module: String = "Aliucord")

Functions

Link copied to clipboard
fun debug(msg: String)

Logs a Log.DEBUG message

Link copied to clipboard
fun error(throwable: Throwable?)

Logs an exception

fun error(ctx: Context?, throwable: Throwable?)

Logs an exception and shows the user a toast saying "Sorry, something went wrong. Please try again."

fun error(msg: String, throwable: Throwable?)

Logs a Log.ERROR message and prints the stacktrace of the exception

Link copied to clipboard
fun errorToast(throwable: Throwable?)

Logs an exception and shows the user a toast saying "Sorry, something went wrong. Please try again."

fun errorToast(msg: String, throwable: Throwable? = null)
fun errorToast(ctx: Context?, msg: String, throwable: Throwable? = null)

Logs a Log.ERROR message, shows it to the user as a toast and prints the stacktrace of the exception

Link copied to clipboard
fun info(ctx: Context?, msg: String)

Logs a Log.INFO message, and shows it to the user as a toast

fun info(msg: String, throwable: Throwable? = null)

Logs a Log.INFO message and prints the stacktrace of the exception

Link copied to clipboard
fun infoToast(msg: String)

Logs a Log.INFO message, and shows it to the user as a toast

Link copied to clipboard
fun verbose(msg: String)

Logs a Log.VERBOSE message

Link copied to clipboard
fun warn(msg: String, throwable: Throwable? = null)

Logs a Log.WARN message and prints the stacktrace of the exception

Properties

Link copied to clipboard