Added method for logging formatted messages using PrintStream format method.