mirror of
https://github.com/apple/swift-log
synced 2026-11-23 03:44:22 +00:00
Add compile-time traits for eliminating log levels from binaries ### Motivation: Applications often know in advance which log levels will never be needed in production. For example, a production service might only need warning and above, while trace and debug levels are only useful during development. This PR introduces compile-time traits that completely eliminate unwanted log levels from binaries, achieving zero runtime overhead for disabled log statements. ### Modifications: - Added seven `MaxLogLevel*` traits - Extended benchmarks with the `MaxLogLevelWarning` suite - Added "Disable log levels during compilation" section to the best practices guide ### Result: Users can eliminate unwanted log levels at compile time by specifying traits in their `Package.swift` dependency declaration.