replace println with logging to resolve #6