本文整理汇总了Java中java.util.logging.LogRecord.setResourceBundleName方法的典型用法代码示例。如果您正苦于以下问题:Java LogRecord.setResourceBundleName方法的具体用法?Java LogRecord.setResourceBundleName怎么用?Java LogRecord.setResourceBundleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.logging.LogRecord
的用法示例。
在下文中一共展示了LogRecord.setResourceBundleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: windowDeactivated
import java.util.logging.LogRecord; //导入方法依赖的package包/类
@Override
public void windowDeactivated(WindowEvent e) {
// proceed only if switching to external application
if (e.getOppositeWindow() == null) {
synchronized (rp) {
if (task != null) {
task.cancel();
} else {
task = rp.create(this);
}
LOG.fine("Window deactivated, preparing refresh task");
}
if (UILOG.isLoggable(Level.FINE)) {
LogRecord r = new LogRecord(Level.FINE, "LOG_WINDOW_DEACTIVATED"); // NOI18N
r.setResourceBundleName("org.netbeans.core.ui.warmup.Bundle"); // NOI18N
r.setResourceBundle(NbBundle.getBundle(MenuWarmUpTask.class)); // NOI18N
r.setLoggerName(UILOG.getName());
UILOG.log(r);
}
}
}
示例2: testIconOfTheNode
import java.util.logging.LogRecord; //导入方法依赖的package包/类
public void testIconOfTheNode() throws Exception {
LogRecord r = new LogRecord(Level.INFO, "icon_msg");
r.setResourceBundleName("org.netbeans.lib.uihandler.TestBundle");
r.setResourceBundle(ResourceBundle.getBundle("org.netbeans.lib.uihandler.TestBundle"));
r.setParameters(new Object[] { new Integer(1), "Ahoj" });
Node n = UINode.create(r);
assertEquals("Name is taken from the message", "icon_msg", n.getName());
if (!n.getDisplayName().matches(".*Ahoj.*")) {
fail("wrong display name, shall contain Ahoj: " + n.getDisplayName());
}
Image img = n.getIcon(BeanInfo.ICON_COLOR_32x32);
assertNotNull("Some icon", img);
IconInfo imgReal = new IconInfo(img);
IconInfo template = new IconInfo(getClass().getResource("testicon.png"));
assertEquals("Icon from ICON_BASE used", template, imgReal);
assertSerializedWell(r, n);
}
示例3: testIconOfTheNode
import java.util.logging.LogRecord; //导入方法依赖的package包/类
public void testIconOfTheNode() throws Exception {
LogRecord r = new LogRecord(Level.INFO, "icon_msg");
r.setResourceBundleName("org.netbeans.modules.uihandler.TestBundle");
r.setResourceBundle(ResourceBundle.getBundle("org.netbeans.modules.uihandler.TestBundle"));
r.setParameters(new Object[] { new Integer(1), "Ahoj" });
Node n = UINode.create(r);
assertEquals("Name is taken from the message", "icon_msg", n.getName());
if (!n.getDisplayName().matches(".*Ahoj.*")) {
fail("wrong display name, shall contain Ahoj: " + n.getDisplayName());
}
Image img = n.getIcon(BeanInfo.ICON_COLOR_32x32);
assertNotNull("Some icon", img);
IconInfo imgReal = new IconInfo(img);
IconInfo template = new IconInfo(getClass().getResource("testicon.png"));
assertEquals("Icon from ICON_BASE used", template, imgReal);
assertSerializedWell(n);
}
示例4: logUsage
import java.util.logging.LogRecord; //导入方法依赖的package包/类
private static void logUsage(String startType, List<Object> params) {
LogRecord record = new LogRecord(Level.INFO, "USG_PROFILER_" + startType); // NOI18N
record.setResourceBundle(NbBundle.getBundle(GestureSubmitter.class));
record.setResourceBundleName(GestureSubmitter.class.getPackage().getName() + ".Bundle"); // NOI18N
record.setLoggerName(USG_LOGGER.getName());
record.setParameters(params.toArray(new Object[0]));
USG_LOGGER.log(record);
}
示例5: log
import java.util.logging.LogRecord; //导入方法依赖的package包/类
void log() {
// prevent logging of events within 3 minutes from the start of scan. Do not freeze...
if (canLogScanCancel()) {
log(true, true);
} else {
if (System.getProperty(RepositoryUpdater.PROP_SAMPLING) == null) {
// enable profiling just up to the 1st exception report
System.setProperty(RepositoryUpdater.PROP_SAMPLING, "oneshot"); // NOI18N
}
final LogRecord r = new LogRecord(Level.INFO, LOG_MESSAGE_EARLY);
r.setResourceBundle(NbBundle.getBundle(LogContext.class));
r.setResourceBundleName(LogContext.class.getPackage().getName() + ".Bundle"); //NOI18N
r.setLoggerName(LOG.getName());
LOG.log(r);
// schedule the log for later, after enough time elapses.
RequestProcessor.getDefault().post(new Runnable() {
@Override
public void run() {
synchronized (LogContext.this) {
if (finished == 0) {
log(true, true);
}
}
}
}, (int)EXEC_TRESHOLD);
}
}
示例6: testDisplayNameOfTheNode
import java.util.logging.LogRecord; //导入方法依赖的package包/类
public void testDisplayNameOfTheNode() throws Exception {
LogRecord r = new LogRecord(Level.INFO, "test_msg");
r.setResourceBundleName("org.netbeans.lib.uihandler.TestBundle");
r.setResourceBundle(ResourceBundle.getBundle("org.netbeans.lib.uihandler.TestBundle"));
r.setParameters(new Object[] { new Integer(1), "Ahoj" });
Node n = UINode.create(r);
assertEquals("Name is taken from the message", "test_msg", n.getName());
if (!n.getDisplayName().matches(".*Ahoj.*1.*")) {
fail("wrong display name, shall contain Ahoj and 1: " + n.getDisplayName());
}
assertSerializedWell(r, n);
}
示例7: testDontPrintLocalizedMessage
import java.util.logging.LogRecord; //导入方法依赖的package包/类
public void testDontPrintLocalizedMessage() throws IOException{
LogRecord log = new LogRecord(Level.INFO, "test_msg");
log.setResourceBundleName("org.netbeans.lib.uihandler.TestBundle");
log.setResourceBundle(ResourceBundle.getBundle("org.netbeans.lib.uihandler.TestBundle"));
log.setParameters(new Object[] { new Integer(1), "Ahoj" });
ByteArrayOutputStream os = new ByteArrayOutputStream();
LogRecords.write(os, log);
assertFalse("no localized message is printed" + os.toString(), os.toString().contains(" and "));
assertTrue("key", os.toString().contains("<key>test_msg</key>"));
assertTrue("no localized message", os.toString().contains("<message>test_msg</message>"));
}
示例8: logDebugStart
import java.util.logging.LogRecord; //导入方法依赖的package包/类
static void logDebugStart(Session s, List<DebuggerEngine> engines) {
LogRecord record = new LogRecord(Level.INFO, "USG_DEBUG_SESSION_START"); // NOI18N
record.setResourceBundle(NbBundle.getBundle(GestureSubmitter.class));
record.setResourceBundleName(GestureSubmitter.class.getPackage().getName() + ".Bundle"); // NOI18N
record.setLoggerName(USG_LOGGER.getName());
List params = new ArrayList();
params.add(s.getName());
params.add(s.getLocationName());
params.add(s.getCurrentLanguage());
record.setParameters(params.toArray(new Object[params.size()]));
USG_LOGGER.log(record);
}
示例9: actionPerformed
import java.util.logging.LogRecord; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent ev) {
LogRecord rec = new LogRecord(Level.FINER, "UI_ACTION_BUTTON_PRESS"); // NOI18N
rec.setParameters(new Object[] { button, button.getClass().getName(), action, action.getClass().getName(), action.getValue(Action.NAME) });
rec.setResourceBundle(NbBundle.getBundle(Actions.class));
rec.setResourceBundleName(Actions.class.getPackage().getName() + ".Bundle"); // NOI18N
rec.setLoggerName(UILOG.getName());
UILOG.log(rec);
}
示例10: logSnapshotTaken
import java.util.logging.LogRecord; //导入方法依赖的package包/类
static void logSnapshotTaken(String language, JPDADebugger debugger) {
synchronized (reportedDebuggers) {
if (reportedDebuggers.contains(debugger)) return;
reportedDebuggers.add(debugger);
}
LogRecord record = new LogRecord(Level.INFO, "USG_DEBUG_VISUAL"); // NOI18N
record.setResourceBundle(NbBundle.getBundle(GestureSubmitter.class));
record.setResourceBundleName(GestureSubmitter.class.getPackage().getName() + ".Bundle"); // NOI18N
record.setLoggerName(USG_LOGGER.getName());
List params = new ArrayList();
params.add(language);
record.setParameters(params.toArray(new Object[params.size()]));
USG_LOGGER.log(record);
}
示例11: createRecord
import java.util.logging.LogRecord; //导入方法依赖的package包/类
private static LogRecord[] createRecord(String msg, Project[] projects) {
if (projects.length == 0) {
return null;
}
Map<String,int[]> counts = new HashMap<String,int[]>();
for (Project p : projects) {
String n = p.getClass().getName();
int[] cnt = counts.get(n);
if (cnt == null) {
cnt = new int[1];
counts.put(n, cnt);
}
cnt[0]++;
}
Logger logger = Logger.getLogger("org.netbeans.ui.projects"); // NOI18N
LogRecord[] arr = new LogRecord[counts.size()];
int i = 0;
for (Map.Entry<String,int[]> entry : counts.entrySet()) {
LogRecord rec = new LogRecord(Level.CONFIG, msg);
rec.setParameters(new Object[] { entry.getKey(), afterLastDot(entry.getKey()), entry.getValue()[0] });
rec.setLoggerName(logger.getName());
rec.setResourceBundle(NbBundle.getBundle(OpenProjectList.class));
rec.setResourceBundleName(OpenProjectList.class.getPackage().getName()+".Bundle");
arr[i++] = rec;
}
return arr;
}
示例12: doLog
import java.util.logging.LogRecord; //导入方法依赖的package包/类
private void doLog(LogRecord lr, String rbname)
{
lr.setLoggerName(_log.getName());
if (rbname != null)
{
lr.setResourceBundleName(rbname);
lr.setResourceBundle(findResourceBundle(rbname));
}
log(lr);
}
示例13: uiLog
import java.util.logging.LogRecord; //导入方法依赖的package包/类
private void uiLog(boolean success) {
LogRecord rec = new LogRecord(Level.FINER, success?"LOG_QUICKSEARCH_ACTION":"LOG_QUICKSEARCH_ACTION_FAILED"); // NOI18N
rec.setParameters(new Object[] { command.getClass().getName(), command.getValue(Action.NAME) });
rec.setResourceBundle(NbBundle.getBundle(ActionsSearchProvider.class));
rec.setResourceBundleName(ActionsSearchProvider.class.getPackage().getName() + ".Bundle"); // NOI18N
rec.setLoggerName(UILOG.getName());
UILOG.log(rec);
}
示例14: log
import java.util.logging.LogRecord; //导入方法依赖的package包/类
private void log() throws MissingResourceException {
LogRecord rec = new LogRecord(Level.FINER, "UI_ACTION_BUTTON_PRESS"); // NOI18N
rec.setParameters(new Object[]{"", "", delegateAction, delegateAction.getClass().getName(), action.getValue(Action.NAME)});
rec.setResourceBundle(NbBundle.getBundle(Actions.class));
rec.setResourceBundleName(Actions.class.getPackage().getName() + ".Bundle"); // NOI18N
rec.setLoggerName(UILOG.getName());
UILOG.log(rec);
}
示例15: log
import java.util.logging.LogRecord; //导入方法依赖的package包/类
private static void log(String type, List<Object> params) {
LogRecord record = new LogRecord(Level.INFO, type);
record.setResourceBundle(NbBundle.getBundle(GestureSubmitter.class));
record.setResourceBundleName(GestureSubmitter.class.getPackage().getName() + ".Bundle"); // NOI18N
record.setLoggerName(USG_LOGGER.getName());
record.setParameters(params.toArray(new Object[params.size()]));
USG_LOGGER.log(record);
}