logger.c ported to D2