Fix writeToLog format codes

The writeToLog function is supposed to replace codes like <<1>> with
values passed in as args, but it wasn't doing so because of a wrong sign
in the text replace. Fixed now.