Hi,
in memory constrained projects, it may seem beneficial to remove all those Log.info() (and any log level for that matter), since the string literals we are printing are stored in memory.
Hence, I believe we can save big amounts of memory if we comment them out right before deployment to production. Ok, ok, we remoce the logs, run some tests, then deploy .
Are there any tricks to do this automagically?
Some options I see:
- write a script to comment out Log.info() and the likes (can hit issues when we are not using {} around blocks, or indentation/writing styles issues)
- use #define to wrap around every single Log.info() and deactivate them at compile time.
Do you know of any other options?
Please comment below.
Thanks!