Replaced direct console output with logging in client