Java Code Examples for java.util.logging.Level.INFO

The following are Jave code examples for showing how to use INFO of the java.util.logging.Level class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: L2jBrasil   File: RequestSendFriendMsg.java   View Source Code Vote up 6 votes
@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);
   }
 
Example 2
Project: incubator-netbeans   File: LibrariesStorage.java   View Source Code Vote up 6 votes
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()
       });
}
 
Example 3
Project: L2jBrasil   File: L2ItemInstance.java   View Source Code Vote up 6 votes
/**
 * 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);
	}
}
 
Example 4
Project: incubator-netbeans   File: MainWindow.java   View Source Code Vote up 6 votes
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 );
}
 
Example 5
Project: scorekeeperfrontend   File: AuditLog.java   View Source Code Vote up 6 votes
@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);
    }
}
 
Example 6
Project: incubator-netbeans   File: DecorableTest.java   View Source Code Vote up 6 votes
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);
}
 
Example 7
Project: openjdk-jdk10   File: SerializeLogRecord.java   View Source Code Vote up 5 votes
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);
    }
}
 
Example 8
Project: incubator-netbeans   File: LogFormatterTest.java   View Source Code Vote up 5 votes
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);
    }
}
 
Example 9
Project: gdx-gamesvcs   File: GpgsClient.java   View Source Code Vote up 5 votes
/**
 * 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;
    }
}
 
Example 10
Project: jtsgen   File: OneLineFormatterTest.java   View Source Code Vote up 5 votes
@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"));
}
 
Example 11
Project: asf-gitpubsub-jenkins-plugin   File: GitPubSubPoll.java   View Source Code Vote up 4 votes
@Override
protected Level getErrorLoggingLevel() {
    return Level.INFO;
}
 
Example 12
Project: incubator-netbeans   File: TrailingWhitespaceRemoveTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.INFO;
}
 
Example 13
Project: incubator-netbeans   File: PersistenceManager.java   View Source Code Vote up 4 votes
/** 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;
}
 
Example 14
Project: asf-gitpubsub-jenkins-plugin   File: ASFGitSCMNavigatorTest.java   View Source Code Vote up 4 votes
@NonNull
@Override
public TaskListener getListener() {
    return new LogTaskListener(Logger.getAnonymousLogger(), Level.INFO);
}
 
Example 15
Project: incubator-netbeans   File: JoinSectionsMod2Test.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.INFO;
}
 
Example 16
Project: incubator-netbeans   File: MultiDataObjectTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.INFO;
}
 
Example 17
Project: incubator-netbeans   File: DeleteCreateTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.INFO;
}
 
Example 18
Project: alvisnlp   File: AbstractAlvisNLP.java   View Source Code Vote up 4 votes
/**
 * CLI option: be quiet.
 */
@CLIOption("-quiet")
public final void quiet() { 
	logLevel = Level.INFO;
}
 
Example 19
Project: Elasticsearch   File: JdkESLogger.java   View Source Code Vote up 4 votes
@Override
protected void internalInfo(String msg) {
    LogRecord record = new ESLogRecord(Level.INFO, msg);
    logger.log(record);
}
 
Example 20
Project: incubator-netbeans   File: MultiDataObjectVersion1Test.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.INFO;
}