📄 logfilter.java
字号:
package com.helpsoft.util.log;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Filter;
import java.util.logging.LogRecord;
/**
* A class for setting a filter
* @author caoguangxin- www.relationinfo.com
*/
public final class LogFilter implements Filter {
/** a filter which should be logged */
private String logFilterValue = "";
/**
* Constrcutor for making a LogFormatter
* @param logFilterValue the filter for logging
*/
public LogFilter(String logFilterValue) {
this.logFilterValue = logFilterValue;
}
/**
* Check to see if the filter is in the logrecord
* @param logRecord the log record to format
* @return boolean true if the filter exists in the logRecord
*/
public boolean isLoggable(LogRecord logRecord) {
return (logRecord.getLoggerName().indexOf(logFilterValue) > -1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -