top | item 36814639

(no title)

crdavidson | 2 years ago

Ooh, hadn't seen @disable before, super useful to know! That'll be handy for doing toggleable build options for tracing / debugging.

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.

discuss

order

memco|2 years ago

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.

zannzen|2 years ago

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

munificent|2 years ago

@disabled is neat. C# has long had the same feature: the [Conditional] attribute.