H
Hoss Spence
Curious how many test their logging statements here. To test that my
logging is what I expect it to be I usually create an instance
variable e.g. mLogMessage. I set it and log it, then check my
mLogMessage in my Junit test. This allows me to test what I'd expect
my log to be without checking the log file itself. The negative is
that I have a getLogMessage() which is only used by Junit. Wondered
what other approaches people use.
logging is what I expect it to be I usually create an instance
variable e.g. mLogMessage. I set it and log it, then check my
mLogMessage in my Junit test. This allows me to test what I'd expect
my log to be without checking the log file itself. The negative is
that I have a getLogMessage() which is only used by Junit. Wondered
what other approaches people use.