简体   繁体   English

Logger.getLogger(“ Classname” .class.getName())。log(Level.SEVERE,null,ex);

[英]Logger.getLogger(“Classname”.class.getName()).log(Level.SEVERE, null, ex);

try{
///
}
catch (InterruptedException ex) {
Logger.getLogger(*"Classname"*.class.getName()).log(Level.SEVERE, null, ex);

I'm beginer and when i saw a project then it have a class use Thread , Try-catch. 我是一个初学者,当我看到一个项目时,它就有一个使用Thread的类,即Try-catch。

Line 5 what's mean? 第5行是什么意思? Please help me. 请帮我。

Line 5 allows you to get an instance of a logger and then log a message with the given Level (severe) containing the exception's (ex) stacktrace. 第5行允许您获取记录器的实例,然后以给定级别(严重)记录消息,该消息包含异常的(ex)堆栈跟踪。 Check javadoc of the used classes for further details. 检查所用类的javadoc以获取更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Logger.getLogger(class_name.class.getName())导致NullPointerException - Logger.getLogger(class_name.class.getName()) leads to NullPointerException Logger.getLogger(className)和LogFactory.getLog(className)之间的区别? - Difference between Logger.getLogger(className) and LogFactory.getLog(className )? Log4j Logger.getLogger(Class)在使用jMockit和Cobertura运行时抛出NPE - Log4j Logger.getLogger(Class) throws NPE when running with jMockit and Cobertura 为什么 log4j 的 Logger.getLogger() 需要传递一个 Class 类型? - Why log4j's Logger.getLogger() need pass a Class type? 使用私有静态最终Logger logger = Logger.getLogger(Reports.class); 在控制台上打印日志,但未创建文件 - Using private static final Logger logger = Logger.getLogger(Reports.class); print log on console but no file created 如何在每个类中减少Logger.getLogger(...)样板 - How to reduce Logger.getLogger(…) boilerplate in every class class.getName()是否昂贵? - Is class.getName() expensive? 错误:从Spring 1.5.9升级到2.0.1后找不到符号Logger logger = Logger.getLogger(this.getClass()。getName()) - error: cannot find symbol Logger logger = Logger.getLogger(this.getClass().getName()) after Spring 1.5.9 upgrade to 2.0.1 静态调用Class.getName() - static invocation of Class.getName() 使用jmock模拟Logger.getLogger() - mocking Logger.getLogger() using jmock
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM