EnvironmentLogger is a cross-platform logging framework that is configured using environment variables, similar to env_logger.
The framework is supported on iOS, macOS, watchOS, tvOS, visionOS, GNU/Linux, musl/Linux, Android and Windows. FreeBSD support will be added once I figure out how to sanely develop on that operating system.
Note
The logger is routed to stderr on non-Apple operating systems.
Important
The logger is routed directly to the unified logging system on all Apple operating systems (or anywhere that os.log can be imported).
As more projects written in Swift target non-Apple operating systems,
EnvironmentLogger is configured using two variables:
LOG_LEVEL: The level to print logs from. This can betrace,debug,info,warning, orerror(default).LOG_MODE: The mode to print logs in. This can bepretty(default),timed, orfull.
This library was created partially using Google Gemini to summarize documentation of the APIs in Foundation.