An ILogger that builds its pino logger on first use: the first call to a
level method or to isLevelEnabled. Nothing is constructed when the module
loads, so importing the package starts no pino instance (CHARTER ARCH-06)
and ESI_LOG_LEVEL is read when the first line is logged, not at import.
On that first call the object replaces its own methods with the built
logger's, so every later call goes straight to pino with no extra hop.
The object's identity never changes, so it can be held and compared.
An
ILoggerthat builds its pino logger on first use: the first call to a level method or toisLevelEnabled. Nothing is constructed when the module loads, so importing the package starts no pino instance (CHARTER ARCH-06) andESI_LOG_LEVELis read when the first line is logged, not at import.On that first call the object replaces its own methods with the built logger's, so every later call goes straight to pino with no extra hop. The object's identity never changes, so it can be held and compared.