Moved logging commands to a separate file.
Use a generic function for logging and allow output groups to be appended.

log.open_file = "instrumentation_memory.log", "/foo/instrumentation_memory.log", "instrumentation_memory", ...
Added 'log.open_file_pid' and 'log.open_gz_file_pid' commands that appends the pid automatically.