replace system.err with nicer logger call