replacing sout with logging