修复log模块获取接口名失败时会出现异常的BUG

This commit is contained in:
mxd 2021-11-13 00:43:16 +08:00
parent 4bec10d364
commit e42b159e3b

View File

@ -476,7 +476,7 @@ public class MagicAPIAutoConfiguration implements WebMvcConfigurer, WebSocketCon
}).orElse(null)
);
logger.info("注册模块:{} -> {}", "log", Logger.class);
MagicResourceLoader.addModule("log", new DynamicModuleImport(Logger.class, context -> LoggerFactory.getLogger(context.getScriptName())));
MagicResourceLoader.addModule("log", new DynamicModuleImport(Logger.class, context -> LoggerFactory.getLogger(Objects.toString(context.getScriptName(),"Unknown"))));
List<String> importModules = properties.getAutoImportModuleList();
logger.info("注册模块:{} -> {}", "env", EnvModule.class);
MagicResourceLoader.addModule("env", new EnvModule(environment));