In order to centralise logging to a single file, this script needs to
support a log file argument to write to.
This change also adds timestamps to log entries, and adds a --dry-run
option which is useful for manual testing.
Change-Id: Id4b776de808ea329a299430078c6f3efdb604e02
Partial-Bug: #1789871