Implemented Printer class for formatting messages using ANSI escape