A
anders.johansen
Hi,
I would like to convert code such at this:
if (entry == null) {
log.warning("No entry found in storeEntries for
arcfilename: "
+ arcfileName);
}
....to this:
LogWarning.ifNull(entry, "No entry found in storeEntries for
arcfilename: " + arcFileName);
In effect consolidating common logging situations to one line of code.
Unfortunately, this means that the cost of constructing the message
must be paid always, and not just when the test fails. This has been
raised as a potential concern by some of my collaborators. In
particular, some like to construct lengthy messages in case of fails,
involving DB lookups etc.
Is there any easy way to deal with this, that retains the simple syntax
for the programmer?
Sincerely,
Anders S. Johansen
I would like to convert code such at this:
if (entry == null) {
log.warning("No entry found in storeEntries for
arcfilename: "
+ arcfileName);
}
....to this:
LogWarning.ifNull(entry, "No entry found in storeEntries for
arcfilename: " + arcFileName);
In effect consolidating common logging situations to one line of code.
Unfortunately, this means that the cost of constructing the message
must be paid always, and not just when the test fails. This has been
raised as a potential concern by some of my collaborators. In
particular, some like to construct lengthy messages in case of fails,
involving DB lookups etc.
Is there any easy way to deal with this, that retains the simple syntax
for the programmer?
Sincerely,
Anders S. Johansen