Hey everyone I am new to the Odin language and I really like it so far! I’m trying to understand the precise behavior of log.debugf in a release build (-o:speed).
Specifically:
- If I have a line like
log.debugf("Value: %v", get_expensive_data()), and at runtime mycontext.loggeris eithernilor set to.Errorlevel, is the call toget_expensive_data()still executed? - Does the compiler physically strip the
log.debugfcalls and their associated format strings from the binary, or are they kept in the executable and simply ‘silenced’ by a runtime check of the context’s log level? - If I want to ensure zero runtime overhead and zero string bloat for debug logs in my final binary, is a wrapper using
@(disabled=...)the recommended way, or does the compiler/core library have an automatic way to handle this?"