add logging functionality