Created a logging object to write messages to the console and/or a
logfile.