switch print messages with log messages