解析 Java 中记录器行的源代码
我正在尝试读取应用程序的源代码,并通过解析它们,找到记录器行并确定格式化字符串和输入之间类型不匹配的记录器行。示例:
appLogger.debug(()->“There are %d %s
errors occurred in method %s”,
anInteger, anInteger,aString);
作为示例,上面的第二个格式化程序和相应的错误具有类型不匹配。但是当这些发生在运行时时,例如使用方法等,在编译期间无法检测到。
我尝试了反射等,但由于我是编程新手,我找不到这样做的方法。感谢您的帮助。
提前致谢。
I am trying to read the source codes of an application, and by parsing them, find the logger lines and determine those with type mismatch between the formatted string and inputs. An example:
appLogger.debug(()->“There are %d %s
errors occurred in method %s”,
anInteger, anInteger,aString);
As an example, above the second formatter and the corresponding error has type mismatch. But when these occur at runtime, such as using methods etc. it cannot be detected during compilation.
I tried reflection, etc. but since I am new to programming, I could not find a way of doing this. Appreciate your help.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论