本文整理匯總了Java中java.util.logging.Level.INFO屬性的典型用法代碼示例。如果您正苦於以下問題:Java Level.INFO屬性的具體用法?Java Level.INFO怎麽用?Java Level.INFO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.util.logging.Level
的用法示例。
在下文中一共展示了Level.INFO屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: runImpl
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null) return;
L2PcInstance targetPlayer = L2World.getInstance().getPlayer(_reciever);
if (targetPlayer == null)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME));
return;
}
if (Config.LOG_CHAT)
{
LogRecord record = new LogRecord(Level.INFO, _message);
record.setLoggerName("chat");
record.setParameters(new Object[]{"PRIV_MSG", "[" + activeChar.getName() + " to "+ _reciever +"]"});
_logChat.log(record);
}
FriendRecvMsg frm = new FriendRecvMsg(activeChar.getName(), _reciever, _message);
targetPlayer.sendPacket(frm);
}
示例2: logBrokenLibraryDescripor
private void logBrokenLibraryDescripor(
@NonNull FileObject descriptorFile,
@NonNull Exception cause){
Level level = Level.WARNING;
if (cause instanceof LibraryDeclarationHandlerImpl.UnknownLibraryTypeException) {
if (((LibraryDeclarationHandlerImpl.UnknownLibraryTypeException) cause).type.equals("j2se")) {
// possibly in a unit test, be quiet
level = Level.FINE;
} else {
//log unknown library type as INFO common with FoD
level = Level.INFO;
}
}
LOG.log(
level,
"Cannot load library from file {0}, reason: {1}", //NOI18N
new Object[] {
FileUtil.getFileDisplayName(descriptorFile),
cause.getMessage()
});
}
示例3: changeCount
/**
* Sets the quantity of the item.<BR><BR>
* <U><I>Remark :</I></U> If loc and loc_data different from database, say datas not up-to-date
* @param process : String Identifier of process triggering this action
* @param count : int
* @param creator : L2PcInstance Player requesting the item creation
* @param reference : L2Object Object referencing current action like NPC selling item or previous item in transformation
*/
public void changeCount(String process, int count, L2PcInstance creator, L2Object reference)
{
if (count == 0) return;
if ( count > 0 && _count > Integer.MAX_VALUE - count) _count = Integer.MAX_VALUE;
else _count += count;
if (_count < 0) _count = 0;
_storedInDb = false;
if (Config.LOG_ITEMS)
{
LogRecord record = new LogRecord(Level.INFO, "CHANGE:" + process);
record.setLoggerName("item");
record.setParameters(new Object[]{this, creator, reference});
_logItems.log(record);
}
}
示例4: logLookAndFeelUsage
private static void logLookAndFeelUsage() {
if( lafLogged )
return;
lafLogged = true;
LookAndFeel laf = UIManager.getLookAndFeel();
Logger logger = Logger.getLogger( "org.netbeans.ui.metrics.laf" ); // NOI18N
LogRecord rec = new LogRecord( Level.INFO, "USG_LOOK_AND_FEEL" ); //NOI18N
String lafId = laf.getID();
if( laf.getDefaults().getBoolean( "nb.dark.theme" ) ) //NOI18N
{
lafId = "DARK " + lafId; //NOI18N
}
rec.setParameters( new Object[]{ lafId, laf.getName() } );
rec.setLoggerName( logger.getName() );
logger.log( rec );
}
示例5: event
@Override
public void event(MT type, Object o)
{
try
{
LogRecord r = new LogRecord(Level.INFO, type.toString());
switch (type)
{
case FINISH_LEFT: r.setMessage(String.format("L+%03.3f", ((ColorTime)((Object[])o)[0]).time)); break;
case FINISH_RIGHT: r.setMessage(String.format(" R+%03.3f", ((ColorTime)((Object[])o)[0]).time)); break;
case DELETE_FINISH_LEFT: r.setMessage( "L-DELETE"); break;
case DELETE_FINISH_RIGHT: r.setMessage( " R-DELETE"); break;
}
audit.publish(r);
}
catch (Exception e)
{
log.log(Level.INFO, "audit log error: {0}", e);
}
}
示例6: testIconOfTheNode
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);
}
示例7: generate
public static void generate() {
try {
LogRecord record = new LogRecord(Level.INFO, "Java Version: {0}");
record.setLoggerName("test");
record.setParameters(new Object[] {System.getProperty("java.version")});
System.out.println(generate(record));
} catch (IOException | ClassNotFoundException x) {
throw new RuntimeException(x);
}
}
示例8: testFormatterDoesNotIncludeHashOnMenu
public void testFormatterDoesNotIncludeHashOnMenu() throws ClassNotFoundException {
LogRecord r = new LogRecord(Level.INFO, "MENU");
SA sa = SA.get(SA.class);
r.setParameters(new Object[] { new JMenuItem(sa) });
Formatter formatter = new LogFormatter();
String s = formatter.format(r);
assertEquals("No @\n" + s, -1, s.indexOf("@"));
if (s.indexOf("SomeName") == -1) {
fail("SomeName should be there:\n" + s);
}
if (s.indexOf("LogFormatterTest$SA") == -1) {
fail("LogFormatterTest$SA should be there:\n" + s);
}
}
示例9: getLogLevel
/**
* Gdx to Log4j log level mapping
*/
private static Level getLogLevel(int logLevel) {
switch (logLevel) {
case Application.LOG_NONE:
return Level.OFF;
case Application.LOG_ERROR:
return Level.SEVERE;
case Application.LOG_INFO:
return Level.INFO;
case Application.LOG_DEBUG:
return Level.FINEST;
default:
return Level.ALL;
}
}
示例10: test_oneline_format
@Test
public void test_oneline_format() throws Exception {
OneLineFormatter f = new OneLineFormatter();
LogRecord x = new LogRecord(Level.INFO,"test");
x.setThrown(new IllegalArgumentException());
assertThat(f.format(x), CoreMatchers.containsString("exception: java.lang.IllegalArgumentException"));
}
示例11: getErrorLoggingLevel
@Override
protected Level getErrorLoggingLevel() {
return Level.INFO;
}
示例12: logLevel
@Override
protected Level logLevel() {
return Level.INFO;
}
示例13: warningLevelForDeserTC
/** Avoid printing dozens of warnings about the same ID in one IDE session. */
private Level warningLevelForDeserTC(String id) {
return warnedIDs.add(id) ? Level.INFO : Level.FINE;
}
示例14: getListener
@NonNull
@Override
public TaskListener getListener() {
return new LogTaskListener(Logger.getAnonymousLogger(), Level.INFO);
}
示例15: quiet
/**
* CLI option: be quiet.
*/
@CLIOption("-quiet")
public final void quiet() {
logLevel = Level.INFO;
}