optimize logger.c
Merge pull request #1 from Gava97/patch-1

optimize logger.c