NullLogger
NullLogger is a no-op implementation of a logger used to satisfy a logging interface without producing any output. It adheres to the same API as a standard logger, but all operations are effectively disabled, making it a safe default in code that depends on a logger.
The primary purpose of a NullLogger is to follow the Null Object design pattern. By providing a
Typically, a NullLogger implements the common logging surface found in many frameworks, including methods for debug,
Common use cases include providing a default logger for libraries or modules that require a logger to
In summary, NullLogger offers a safe, minimal-cost way to satisfy logging dependencies when no actual logging