function to log battery status when it is called