android-components / mozilla.components.support.base.log.logger / Logger

Logger

class Logger (source)

A wrapper for the Log object providing a more convenient API for logging.

Parameters

tag - The tag to be used for log messages send via this logger.

Constructors

Name Summary
<init> Logger(tag: String? = null)
A wrapper for the Log object providing a more convenient API for logging.

Functions

Name Summary
debug fun debug(message: String? = null, throwable: Throwable? = null): Unit
Send a DEBUG log message.
error fun error(message: String? = null, throwable: Throwable? = null): Unit
Send a ERROR log message.
info fun info(message: String? = null, throwable: Throwable? = null): Unit
Send a INFO log message.
measure fun measure(message: String, block: () -> Unit): Unit
Measure the time it takes to execute the provided block and print a log message before and after executing the block.
warn fun warn(message: String? = null, throwable: Throwable? = null): Unit
Send a WARN log message.

Companion Object Functions

Name Summary
debug fun debug(message: String? = null, throwable: Throwable? = null): Unit
Send a DEBUG log message.
error fun error(message: String? = null, throwable: Throwable? = null): Unit
Send a ERROR log message.
info fun info(message: String? = null, throwable: Throwable? = null): Unit
Send a INFO log message.
measure fun measure(message: String, block: () -> Unit): Unit
Measure the time it takes to execute the provided block and print a log message before and after executing the block.
warn fun warn(message: String? = null, throwable: Throwable? = null): Unit
Send a WARN log message.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.