log errors to stderr if a logger is not supplied.