public class ExceptionLogger extends Object implements ExceptionWatcher
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ExceptionLogger.CountLogWatcher
记录警告日志并统计失败次数的异常处理类
忽略异常, 记录警告日志并统计失败次数, 发生异常后继续处理 |
| 限定符和类型 | 字段和说明 |
|---|---|
static ExceptionLogger |
DETAILS
记录详细日志的实例
|
static ExceptionLogger |
SIMPLE
记录简单日志的实例
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
ExceptionLogger(boolean details)
构造函数
|
protected |
ExceptionLogger(boolean details,
Class<?> clazz)
构造函数
|
protected |
ExceptionLogger(boolean details,
String loggerName)
构造函数
|
| 限定符和类型 | 方法和说明 |
|---|---|
static ExceptionLogger.CountLogWatcher |
newCountWatcher(boolean details)
生成一个记录警告日志并统计失败次数的实例
|
static ExceptionLogger.CountLogWatcher |
newCountWatcher(boolean details,
Class<?> clazz)
生成一个记录警告日志并统计失败次数的实例
|
static ExceptionLogger.CountLogWatcher |
newCountWatcher(boolean details,
String loggerName)
生成一个记录警告日志并统计失败次数的实例
|
static ExceptionLogger |
newLogWatcher(boolean details)
生成一个只记录警告日志的实例
|
static ExceptionLogger |
newLogWatcher(boolean details,
Class<?> clazz)
生成一个只记录警告日志的实例
|
static ExceptionLogger |
newLogWatcher(boolean details,
String loggerName)
生成一个只记录警告日志的实例
|
boolean |
onCaughtException(String message,
Throwable e) |
public static final ExceptionLogger SIMPLE
public static final ExceptionLogger DETAILS
protected ExceptionLogger(boolean details)
details - 是否记录StackTraceprotected ExceptionLogger(boolean details,
Class<?> clazz)
details - 是否记录StackTraceclazz - the logger will be named after clazzprotected ExceptionLogger(boolean details,
String loggerName)
details - 是否记录StackTraceloggerName - the name of the loggerpublic static ExceptionLogger newLogWatcher(boolean details)
details - 是否记录StackTracepublic static ExceptionLogger newLogWatcher(boolean details, Class<?> clazz)
details - 是否记录StackTraceclazz - the logger will be named after clazzpublic static ExceptionLogger newLogWatcher(boolean details, String loggerName)
details - loggerName - public static ExceptionLogger.CountLogWatcher newCountWatcher(boolean details)
details - 是否记录StackTracepublic static ExceptionLogger.CountLogWatcher newCountWatcher(boolean details, Class<?> clazz)
details - 是否记录StackTraceclazz - the logger will be named after clazzpublic static ExceptionLogger.CountLogWatcher newCountWatcher(boolean details, String loggerName)
details - loggerName - public boolean onCaughtException(String message, Throwable e)
onCaughtException 在接口中 ExceptionWatcherCopyright © 2020. All rights reserved.