Log error in command line tool