replace "print" with logging