本文整理汇总了Java中java.util.logging.Filter.isLoggable方法的典型用法代码示例。如果您正苦于以下问题:Java Filter.isLoggable方法的具体用法?Java Filter.isLoggable怎么用?Java Filter.isLoggable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.logging.Filter
的用法示例。
在下文中一共展示了Filter.isLoggable方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLoggable
import java.util.logging.Filter; //导入方法依赖的package包/类
@Override
public boolean isLoggable(LogRecord record) {
if(record==null){
return false;
}
int levelValue = getLevel().intValue();
if (record.getLevel().intValue() < levelValue || levelValue == offValue) {
return false;
}
Filter filter = getFilter();
if (filter == null) {
return true;
}
return filter.isLoggable(record);
}
示例2: publish
import java.util.logging.Filter; //导入方法依赖的package包/类
/**
* Publishes the record.
*/
@Override
public final void publish(LogRecord record)
{
if (! isLoggable(record)) {
return;
}
Filter filter = getFilter();
if (filter != null && ! filter.isLoggable(record))
return;
if (record == null) {
System.out.println(this + ": no record");
return;
}
//synchronized (this) {
processPublish(record);
//processFlush();
//}
/*
_logQueue.offer(record);
if (CurrentTime.isTest()) {
waitForEmpty();
}
*/
}
示例3: isLoggable
import java.util.logging.Filter; //导入方法依赖的package包/类
@Override
public boolean isLoggable(final @Nullable LogRecord record) {
if (oldFilter != null && !oldFilter.isLoggable(record))
return false;
for (final Filter f : filters)
if (!f.isLoggable(record))
return false;
return true;
}
示例4: isLoggable
import java.util.logging.Filter; //导入方法依赖的package包/类
@Override
public boolean isLoggable(LogRecord record) {
for (Filter filter : filters) {
if (!filter.isLoggable(record)) {
return false;
}
}
return true;
}
示例5: publishToLogger
import java.util.logging.Filter; //导入方法依赖的package包/类
private void publishToLogger( Logger logger, LogRecord record )
{
if ( !logger.isLoggable( record.getLevel( ) ) )
{
return;
}
synchronized ( logger )
{
Filter filter = logger.getFilter( );
if ( filter != null && !filter.isLoggable( record ) )
{
return;
}
}
// Post the LogRecord to all our Handlers, and then to
// our parents' handlers, all the way up the tree.
while ( logger != null )
{
Handler targets[] = logger.getHandlers( );
if ( targets != null )
{
for ( int i = 0; i < targets.length; i++ )
{
targets[i].publish( record );
}
}
if ( !logger.getUseParentHandlers( ) )
{
break;
}
logger = logger.getParent( );
}
}
示例6: isLoggable
import java.util.logging.Filter; //导入方法依赖的package包/类
@Override
public boolean isLoggable(final LogRecord record) {
for (final Filter f : this.filters) {
if (!f.isLoggable(record)) {
return false;
}
}
return true;
}
示例7: internalLog
import java.util.logging.Filter; //导入方法依赖的package包/类
protected void internalLog(final LogRecord record) {
final Filter filter = getFilter();
if (filter != null && !filter.isLoggable(record)) {
return;
}
final String msg = formatMessage(record);
internalLogFormatted(msg, record);
}
示例8: isFiltered
import java.util.logging.Filter; //导入方法依赖的package包/类
boolean isFiltered(final LogRecord logRecord) {
final Filter filter = getFilter();
return filter != null && !filter.isLoggable(logRecord);
}