use logging properly and remove use of timestamp