Fix #1024. Use log.debug instead of println in TrapExit.