本文整理匯總了Java中java.util.logging.LogRecord.getResourceBundleName方法的典型用法代碼示例。如果您正苦於以下問題:Java LogRecord.getResourceBundleName方法的具體用法?Java LogRecord.getResourceBundleName怎麽用?Java LogRecord.getResourceBundleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.logging.LogRecord
的用法示例。
在下文中一共展示了LogRecord.getResourceBundleName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: publish
import java.util.logging.LogRecord; //導入方法依賴的package包/類
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
lastParams = record.getParameters();
lastThrown = record.getThrown();
lastMessage = record.getMessage();
}
示例2: publish
import java.util.logging.LogRecord; //導入方法依賴的package包/類
@Override
public synchronized void publish(LogRecord record) {
Object[] params = record.getParameters();
// Each GetRB thread has its own handler, but since they
// log into the same logger, each handler may receive
// messages emitted by other threads.
// This means that GetRB#2.handler may receive a message
// emitted by GetRB#1 at a time where the resource bundle
// was still null.
// To avoid falling into this trap, the GetRB thread passes
// 'this' as argument to the messages it logs - which does
// allow us here to ignore messages that where not emitted
// by our own GetRB.this thread...
if (params.length == 1) {
if (params[0] == GetRB.this) {
// The message was emitted by our thread.
count++;
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
} else {
// The message was emitted by another thread: just
// ignore it, as it may have been emitted at a time
// where the resource bundle was still null, and
// processing it may overwrite the 'rb' and 'rbName'
// recorded from the message emitted by our own thread.
if (VERBOSE) {
System.out.println("Ignoring message logged by " + params[0]);
}
ignoreLogCount.incrementAndGet();
}
} else {
ignoreLogCount.incrementAndGet();
System.err.println("Unexpected message received");
}
}
示例3: publish
import java.util.logging.LogRecord; //導入方法依賴的package包/類
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
}