add logging to optimize_mythdb.pl