Moved some logging code into logging.c
Changed a printf statement to logging