def logging(logger, message):
if null == logger:
return
if null == message:
return
logger.write(message)
I don't understand why the author would even bother with more than this, given his example. Also note that I used two return (disguised goto's) as guard statements to check the conditions before I do anything.