Change logging functions so I don't get confused about what they do. Added parameter to name the log file if called directly.