Defines a handler which writes to the console.