You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3e6096d
Browse filesBrowse the repository at this point in the historyBrowse files
Fix#598: Allow external configuration of logStartupMessage via Properties and Env Vars (#602)
* Implement easily configurable logStartupMessage (#598)
Addresses #598 by adding support for configuring KotlinLoggingConfiguration.logStartupMessage externally via System Properties and Environment Variables across all supported Kotlin Multiplatform platforms.
Currently, disabling the startup message programmatically can be awkward or impossible if top-level loggers initialize KotlinLogging during class loading before main() or test setups have a chance to run. Providing external configuration flags completely bypasses this initialization order constraint.
To maintain backward compatibility and avoid confusing users who rely on startup diagnostics, the default behavior remains true (opt-out).
Cross-Platform Implementation Details
The default value for logStartupMessage is now dynamically resolved during initialization based on the platform:
JVM & Android: Checks the JVM System Property kotlin-logging.logStartupMessage first, then falls back to the Environment Variable KOTLIN_LOGGING_STARTUP_MESSAGE.
Native & Darwin: Uses POSIX getenv to check the KOTLIN_LOGGING_STARTUP_MESSAGE environment variable.
JS & Wasm JS: Safely evaluates the Browser environment (window.KOTLIN_LOGGING_STARTUP_MESSAGE) or Node.js environment (process.env.KOTLIN_LOGGING_STARTUP_MESSAGE). Returns false if either resolves to "false" or boolean false.
0 commit comments