I find that log messages I add during development generally do one of three things:
- Aid in debugging and testing new, unfinished features and code paths
- Provide information about the normal operation of the program such as task completion and common error conditions (e.g. no internet connection).
- Provide detailed information about unusual or unexpected events, including error conditions that are dangerous or not specifically handled, software updates, and malformed data coming from a server connection or file
Messages in category one I usually remove when the feature is complete, messages in category two I filter out with a macro like the one in the linked question, and messages in category three I leave in the release.
Obviously the lines are blurry, but I think it comes down to respecting the log. If your application floods it with information that isn't useful, it could make it difficult to notice errors from other applications, and will be a (small) resource drain.
Using ASL functions to log messages with lower priorities like debug
and info
that won't be visible to most users is a great idea for messages that fall in a grey area.