cleaned redundant code in logger.c