This question seems like one someone had probably asked before, but after some searches on the web, and specifically SO, I haven't found an answer to this specific question, but lots of other vaguely-related ones.
So I'm working on my Android app, and adding a lot of very detailed VERBOSE log messages - Log.v()
, just for my own learning as I go along. These will likely be removed down the road, as they are just training wheels now and I'm curious to see how everything runs.
From what I think I've learned about statically-compiled languages like C++, where you can specify to a preprocessor certain flags for log level or debugging, etc., you can generate multiple binaries of the same app with different log levels and thus, runtime speed. So you get the typical debug and release binaries, with some other differences of course.
For Java, and particular Android, I see that I can alter the log level while the app is running as I watch the output in Intellij (or Eclipse, etc.).
Core question: Does anyone know if keeping more verbose logging statements in an app (VERBOSE
, DEBUG
, maybe INFO
), can still hinder performance even when the log filter is set low like FATAL
, ERROR
, WARN
or even off?
I can do some performance testing and find out, but I feel like this general-purpose question may be helpful to know without having to manually try that. Something other developers with interest in healthy logging may want to know.
This is important to me because I don't want to have to rip out lots of logging messages I've added all over the code framework just to not have a runtime speed impact. And maybe it's possible that I won't have to do that, if there is no performance impact of unused logging statements.