Logging function moved to separate file.