I was curious after reading: can the @disable behavior be modified at runtime? For long running programs I find it helpful to be able to set a certain log level up front but have a way to update it without rebuilding or restarting the program. There may be other operations that can’t immediately be shut down and restarted so requiring a rebuild or restart to get debug logs is not an option in those cases.
It cannot, it's purely a build-time feature. The disabled proc isn't even in the binary if you disassemble it.
Also for the record I just noticed I wrote @disable everywhere instead of @disabled. That's been fixed now
Re:Small Joys with Odin
by munificent on Friday July 21, 2023 @12:32PM
(#36815900)
@disabled is neat. C# has long had the same feature: the [Conditional] attribute.
I've been using Odin for about a year now, many of the pain-points I've had have just been knowledge gaps. Odin's docs and debug info have slowly gotten better over time, and little discord-community tips here and there have made a huge difference for my quality of life.