SpeziLogger

A utility class for logging messages using different logging strategies.

This class provides inline functions for logging with crossinline lambdas to preserve the control flow within the logging methods. By using inline functions, large string messages are not allocated in memory unnecessarily, optimizing performance.

See also

and groupLogger for configuration options and how to create SpeziLogger instances.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
@get:VisibleForTesting
val logger: _Logger?

Retrieves the logger instance if logging is enabled.

Functions

Link copied to clipboard
inline fun e(throwable: Throwable? = null, crossinline message: () -> String)

Logs an error message.

Link copied to clipboard
inline fun i(throwable: Throwable? = null, crossinline message: () -> String)

Logs an informational message.

Link copied to clipboard

Sets the next tag for logging.

Link copied to clipboard
inline fun w(throwable: Throwable? = null, crossinline message: () -> String)

Logs a warning message.

Link copied to clipboard

Creates a new SpeziLogger instance with the specified message prefix.