Format print/log messages