Moved logging function to its own file, starting work on logging