add logging function to bot