Use logger instead of printing to stderr/stdout directly