Replaced printlns with logs.