本文整理匯總了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);
}