Separated battery logging from battery.pl to log.pl