making sure that the log is appended
re-scoping the memusage to put in to the log