LogFormatter defines an interface for formatting log messages. Implementations
of this class should convert log messages and their associated data (such as log
level, timestamp, error information, and stack traces) into a string format suitable
for display or storage. This allows for customizable log message layouts and the
inclusion of relevant information as needed.
Logger serves as a flexible and configurable logging utility designed to support
various logging levels and formats. It follows the Singleton pattern to ensure a
consistent logging mechanism throughout the application. This class allows for detailed
logging control, including setting minimum log levels, customizing log message formats,
and specifying log output destinations through adapters.
LoggerAdapter serves as an abstract base for implementing various logging
output mechanisms. It defines a set of methods corresponding to different
log levels, each accepting log messages, optional stack traces, and a formatter
to format the log output. Implementers of this class can direct log output
to various destinations such as the console, files, databases, or external
logging services.
LoggerBuilder provides a fluent interface for constructing and configuring
a Logger instance. It allows for setting the minimum log level, choosing a
specific log adapter, and defining a custom log message formatter.