vayu.log¶
log
¶
Library logger.
Vayu uses a named "vayu" logger (L) with a NullHandler attached so that
importing the library has no effect on the root logger or global logging config.
Applications are expected to configure handlers/levels themselves. For parity
with the previous stdout-with-timezone behavior, call configure() at startup.
configure
¶
configure(
level: Optional[str] = None,
tz: Optional[str] = None,
stream: IO = stdout,
fmt: str = "[%(asctime)s] %(levelname)s> %(message)s",
) -> None
Configure the vayu logger with a stdout handler and timezone-aware timestamps.
Off by default so that importing the library does not mutate global logging state. Call once at application startup to opt in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
Optional[str]
|
log level (default: env var LOG_LEVEL, else "INFO"). |
None
|
tz
|
Optional[str]
|
IANA timezone for timestamps (default: env var TZ, else "UTC"). |
None
|
stream
|
IO
|
handler output stream. |
stdout
|
fmt
|
str
|
log record format. |
'[%(asctime)s] %(levelname)s> %(message)s'
|