Fix FileLogger and made it static. And fix change of battery state in new api