Fix a bug in Logger: Don't print the stacktrace twice