Java Code Examples for java.util.logging.Logger.log()

The following are Jave code examples for showing how to use log() of the java.util.logging.Logger class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: BeamTeamDiscordBot   File: ConstellationManager.java   Source Code and License Vote up 6 votes
private static void handleUserFollowed(LiveEvent event, JsonObject payload) {
	try {
		if (Files.notExists(Paths.get("payloads\\"))) {
			new File("payloads\\").mkdir();
		}

		Logger logger = Logger.getLogger("payload-userFollowed");
		FileHandler fh = new FileHandler("payloads\\" + logger.getName() + ".json");
		SimpleFormatter formatter = new SimpleFormatter();
		fh.setFormatter(formatter);

		logger.addHandler(fh);

		logger.log(Level.INFO, payload.toString());
	} catch (SecurityException | IOException e) {}
}
 
Example 2
Project: tcp   File: ConnectionConfiguration.java   Source Code and License Vote up 6 votes
public static Connection conectarBase(){
	 Connection con = null;
        Statement st = null;
        ResultSet rs = null;
        try {Class.forName("org.postgresql.Driver");}
        catch (ClassNotFoundException e) {e.printStackTrace();}
        String url = "";
        String user = "bpm";
        String password = "cybiraconsulting2";

        try {con = DriverManager.getConnection("jdbc:postgresql://pg02.stp.gov.py/base?useUnicode=true&characterEncoding=UTF-8&user=bpm&password=cybiraconsulting2");}
        catch (SQLException ex) {
            Logger lgr = Logger.getLogger(SqlHelper.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);
        } 
        return con;
}
 
Example 3
Project: tcp   File: ConnectionConfiguration.java   Source Code and License Vote up 6 votes
public static Connection conectar(){
	 Connection con = null; 
        Statement st = null;
        ResultSet rs = null;
        try {Class.forName("org.postgresql.Driver");}
        catch (ClassNotFoundException e) {e.printStackTrace();}
        String url = "";
        String user = "postgres";
        String password = "postgres";

        try {con = DriverManager.getConnection("jdbc:postgresql://pg01.stp.gov.py/tablero2015v3?useUnicode=true&characterEncoding=UTF-8&user=postgres&password=postgres");}
        catch (SQLException ex) {
            Logger lgr = Logger.getLogger(SqlHelper.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);
        } 
        return con;
}
 
Example 4
Project: mm-system-2017   File: DataAccess.java   Source Code and License Vote up 6 votes
public boolean deactivateUser(int id) throws SQLException {
	Logger logger = Logger.getLogger(DataAccess.class.getName());
	logger.log(Level.INFO, "deactivateUser starting...");
	PreparedStatement stm = c.prepareStatement(SQLStatements.selectUserById);
	stm.setInt(1, id);
	ResultSet rs = stm.executeQuery();
	if (rs.next()) {
		logger.log(Level.INFO, "deactivateUser User found:" + id);
		rs.close();
		stm.close();
		PreparedStatement stm2 = c.prepareStatement(SQLStatements.setUserDeactiveById);
		stm2.setInt(1, id);
		stm2.executeUpdate();
		stm2.close();
		return true;
	}
	logger.log(Level.WARNING, "deactivateUser User NOT found");
	rs.close();
	stm.close();

	return false;
}
 
Example 5
Project: incubator-netbeans   File: HandlerTest.java   Source Code and License Vote up 6 votes
public void testLoggingMessageWithBundle() throws Exception {
    FileObject dir  = TimesCollectorPeerTest.makeScratchDir(this);
    
    Logger LOG = Logger.getLogger("TIMER.instance.of.my.object");
    LogRecord rec = new LogRecord(Level.FINE, "LOG_Project"); // NOI18N
    rec.setParameters(new Object[] { dir, dir });
    rec.setResourceBundle(ResourceBundle.getBundle(HandlerTest.class.getName()));
    LOG.log(rec);

    Collection<Object> files = TimesCollectorPeer.getDefault().getFiles();
    assertEquals("One object " + files, 1, files.size());
    
    Description descr = TimesCollectorPeer.getDefault().getDescription(files.iterator().next(), "LOG_Project");
    assertNotNull(descr);
    
    if (descr.getMessage().indexOf("My Project") == -1) {
        fail("Localized msg should contain 'My Project': " + descr.getMessage());
    }
}
 
Example 6
Project: tcp   File: ConnectionConfiguration.java   Source Code and License Vote up 6 votes
public static Connection conectarBase(){
	 Connection con = null;
        Statement st = null;
        ResultSet rs = null;
        try {Class.forName("org.postgresql.Driver");}
        catch (ClassNotFoundException e) {e.printStackTrace();}
        String url = "";
        String user = "bpm";
        String password = "cybiraconsulting2";

        try {con = DriverManager.getConnection("jdbc:postgresql://pg02.stp.gov.py/base?useUnicode=true&characterEncoding=UTF-8&user=bpm&password=cybiraconsulting2");}
        catch (SQLException ex) {
            Logger lgr = Logger.getLogger(SqlHelper.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);
        } 
        return con;
}
 
Example 7
Project: incubator-netbeans   File: InstallerReadPageTest.java   Source Code and License Vote up 6 votes
@RandomlyFails // NB-Core-Build #7964
public void testSendLogWithException() throws Exception {
    Logger uiLogger = Logger.getLogger(Installer.UI_LOGGER_NAME);
    LogRecord log1 = new LogRecord(Level.SEVERE, "TESTING MESSAGE");
    LogRecord log2 = new LogRecord(Level.SEVERE, "TESTING MESSAGE");
    LogRecord log3 = new LogRecord(Level.SEVERE, "NO EXCEPTION LOG");
    LogRecord log4 = new LogRecord(Level.INFO, "INFO");
    Throwable t1 = new NullPointerException("TESTING THROWABLE");
    Throwable t2 = new UnknownError("TESTING ERROR");
    log1.setThrown(t1);
    log2.setThrown(t2);
    log4.setThrown(t2);
    Installer installer = Installer.findObject(Installer.class, true);
    assertNotNull(installer);
    installer.restored();
    uiLogger.log(log1);
    uiLogger.log(log2);
    uiLogger.log(log3);
    UIHandler.waitFlushed();
    if (Installer.getThrown() == null) {
        fail("Exception should be found in the log");
    }
    
    doEncodingTest("UTF-8", "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'></meta>");
}
 
Example 8
Project: tcp   File: ConnectionConfiguration.java   Source Code and License Vote up 6 votes
public static Connection conectarSpr(){
	 Connection con = null;
        Statement st = null;
        ResultSet rs = null;
        //try {Class.forName("com.mysql.jdbc.Driver");}
        try {Class.forName("org.postgresql.Driver");}
        catch (ClassNotFoundException e) {e.printStackTrace();}
        String url = "";
        //String user = "root";
        String user = "postgres";
        String password = "postgres";

        //try {con = DriverManager.getConnection("jdbc:mysql://mysql01.stp.gov.py/spr?useUnicode=true&characterEncoding=UTF-8", "root", "postgres");}
        try {con = DriverManager.getConnection("jdbc:postgresql://pg01.stp.gov.py/spr?useUnicode=true&characterEncoding=UTF-8", "postgres", "postgres");}
        catch (SQLException ex) {
            Logger lgr = Logger.getLogger(SqlHelper.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);
        } 
        return con;
}
 
Example 9
Project: openjdk-jdk10   File: TestConfigurationLock.java   Source Code and License Vote up 6 votes
@Override
public void run() {
    try {
        long rest, previous;
        int msgCount = 0;
        previous = time;
        Logger logger =  Logger.getLogger("remaining");
        while (goOn && (rest = start - System.currentTimeMillis() + time) > 0) {
            if (previous == time || previous - rest >= STEP) {
                logger.log(Level.INFO, "{0}ms remaining...", String.valueOf(rest));
                msgCount++;
                previous = rest == time ? rest -1 : rest;
                System.gc();
            }
            if (goOn == false) break;
            pause(Math.min(rest, 100));
        }
        System.err.println(this + ": " + msgCount + " messages.");
        System.err.flush();
        System.out.println(System.currentTimeMillis() - start
                + " ms elapsed ("+time+ " requested)");
        goOn = false;
    } catch(InterruptedException | RuntimeException x) {
        fail(x);
    }
}
 
Example 10
Project: Uranium   File: WatchdogThread.java   Source Code and License Vote up 5 votes
private static void dumpThread(ThreadInfo thread, Logger log, Level level)
{
    if (thread == null) return;
    if ( thread.getThreadState() != State.WAITING )
    {
        log.log( level, "------------------------------" );
        //
        log.log( level, "Current Thread: " + thread.getThreadName() );
        log.log( level, "\tPID: " + thread.getThreadId()
                + " | Suspended: " + thread.isSuspended()
                + " | Native: " + thread.isInNative()
                + " | State: " + thread.getThreadState() 
                + " | Blocked Time: " + thread.getBlockedTime()     // Cauldron add info about blocked time
                + " | Blocked Count: " + thread.getBlockedCount()); // Cauldron add info about blocked count
        
        if ( thread.getLockedMonitors().length != 0 )
        {
            log.log( level, "\tThread is waiting on monitor(s):" );
            for ( MonitorInfo monitor : thread.getLockedMonitors() )
            {
                log.log( level, "\t\tLocked on:" + monitor.getLockedStackFrame() );
            }
        }
        if ( thread.getLockOwnerId() != -1 ) log.log( level, "\tLock Owner Id: " + thread.getLockOwnerId()); // Cauldron + add info about lock owner thread id
        log.log( level, "\tStack:" );
        //
        StackTraceElement[] stack = thread.getStackTrace();
        for ( int line = 0; line < stack.length; line++ )
        {
            log.log( level, "\t\t" + stack[line].toString() );
        }
    }
}
 
Example 11
Project: incubator-netbeans   File: JUnitOutputReader.java   Source Code and License Vote up 5 votes
/**
 */
private boolean isValidReportFile(File reportFile) {
    if (!reportFile.canRead()) {
        return false;
    }
    
    long lastModified = reportFile.lastModified();
    long timeDelta = lastModified - timeOfSessionStart;
    
    final Logger logger = Logger.getLogger("org.netbeans.modules.junit.outputreader.timestamps");//NOI18N
    final Level logLevel = FINER;
    if (logger.isLoggable(logLevel)) {
        logger.log(logLevel, "Report file: " + reportFile.getPath());//NOI18N
        
        final GregorianCalendar timeStamp = new GregorianCalendar();
        
        timeStamp.setTimeInMillis(timeOfSessionStart);
        logger.log(logLevel, "Session start:    " + String.format("%1$tT.%2$03d", timeStamp, timeStamp.get(GregorianCalendar.MILLISECOND)));//NOI18N
        
        timeStamp.setTimeInMillis(lastModified);
        logger.log(logLevel, "Report timestamp: " + String.format("%1$tT.%2$03d", timeStamp, timeStamp.get(GregorianCalendar.MILLISECOND)));//NOI18N
    }
    
    if (timeDelta >= 0) {
        return true;
    }
    
    return -timeDelta <= timeOfSessionStart % 1000;
    
}
 
Example 12
Project: incubator-netbeans   File: Issue167725DeadlockTest.java   Source Code and License Vote up 5 votes
public void testConcurrentScanDeadlock() throws Exception {
    final Logger LOG = Logger.getLogger("org.netbeans.modules.apisupport.project.universe.ModuleList");
    Logger observer = Logger.getLogger("observer");
    Log.enable("org.netbeans.modules.apisupport.project.universe.ModuleList", Level.ALL);
    
    String mt = "THREAD: Test Watch Dog: testConcurrentScanDeadlock MSG:";
    String wt = "THREAD: worker MSG:";
    String order = 
        mt + "beforeFindOrCreateML" +
        wt + "before PM.mutex" +
        wt + "beforeFindOrCreateML" +
        mt + "runProtected: sync 0";
    Log.controlFlow(LOG, observer, order, 0);
    Thread t = new Thread("worker") {

        @Override
        public void run() {
            try {
                LOG.log(Level.FINE, "before PM.mutex");
                ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() {
                    public Void run() throws Exception {
                        LOG.log(Level.FINE, "beforeFindOrCreateML");
                        ModuleList.findOrCreateModuleListFromNetBeansOrgSources(nbRootFile());
                        LOG.log(Level.FINE, "afterFindOrCreateML");
                        return null;
                    }
                });
            } catch (MutexException ex) {
                throw new RuntimeException(ex);
            }
        }
    };
    t.start();
    LOG.log(Level.FINE, "beforeFindOrCreateML");
    ModuleList.findOrCreateModuleListFromNetBeansOrgSources(nbRootFile());
    LOG.log(Level.FINE, "afterFindOrCreateML");
    t.join();
}
 
Example 13
Project: incubator-netbeans   File: AbstractDocumentComponent.java   Source Code and License Vote up 5 votes
private ModelSource resolveModelSource(String location, 
ModelSource currentSource, CatalogModel currentCatalog) {
ModelSource ms = null;
try {
    if (location != null) {
	ms = currentCatalog.getModelSource(getURI(location), 
	    currentSource);
    } 
} catch (CatalogModelException nse) {
    // unable to resolve location
    Logger l = Logger.getLogger(AbstractDocumentComponent.class.getName());
    l.log(Level.FINE, nse.getMessage());
}
return ms;
   }
 
Example 14
Project: incubator-netbeans   File: PostAttachmentCommand.java   Source Code and License Vote up 5 votes
@Override
public void execute() throws CoreException, IOException, MalformedURLException {
    Logger log = Logger.getLogger(this.getClass().getName());
    if(log.isLoggable(Level.FINE)) {
        log.log(Level.FINE, "executing PostTaskDataCommand for task: {0}", task.getTaskId()); // NOI18N
    }
    AbstractTaskAttachmentHandler taskAttachmentHandler = repositoryConnector.getTaskAttachmentHandler();
    if (!taskAttachmentHandler.canPostContent(taskRepository, task)) {
        throw new IOException("Cannot post attachment for task with id: " + task.getTaskId());
    }
    taskAttachmentHandler.postContent(taskRepository, task, taskAttachmentSource, comment, attAttribute, new NullProgressMonitor());
}
 
Example 15
Project: incubator-netbeans   File: OpenProjectList.java   Source Code and License Vote up 5 votes
private static void log(LogRecord[] arr, String loggerName) {
    if (arr == null) {
        return;
    }
    Logger logger = Logger.getLogger(loggerName); // NOI18N
    for (LogRecord r : arr) {
        logger.log(r);
    }
}
 
Example 16
Project: incubator-netbeans   File: TemplateWizardIterator.java   Source Code and License Vote up 4 votes
@Override
public Set instantiate() throws IOException, IllegalArgumentException {
    Set set = delegateIterator.instantiate();
    FileObject template = (FileObject) set.iterator().next();
    if (wiz instanceof TemplateWizard) {
        Logger logger = Logger.getLogger("org.netbeans.ui.metrics.form"); // NOI18N
        LogRecord rec = new LogRecord(Level.INFO, "USG_FORM_CREATED"); // NOI18N
        rec.setLoggerName(logger.getName());
        rec.setParameters(new Object[] { ((TemplateWizard)wiz).getTemplate().getName() });
        logger.log(rec);
    }

    if (specifySuperclass) {
        final String className = template.getName();
        final String superclassName = 
                ((SuperclassWizardPanel) superclassPanel).getSuperclassName();           
        JavaSource js = JavaSource.forFileObject(template);
        js.runModificationTask(new CancellableTask<WorkingCopy>() {
            @Override
            public void cancel() {
            }
            @Override
            public void run(WorkingCopy wcopy) throws Exception {
                wcopy.toPhase(JavaSource.Phase.RESOLVED);
   
                for (Tree t: wcopy.getCompilationUnit().getTypeDecls()) {
                    if (TreeUtilities.CLASS_TREE_KINDS.contains(t.getKind()) && className.equals(((ClassTree) t).getSimpleName().toString())) {
                        ClassTree orig = (ClassTree) t;
                        TreeMaker maker = wcopy.getTreeMaker();
                        TypeElement superclassElm = wcopy.getElements().getTypeElement(superclassName);
                        ExpressionTree extendsTree = superclassElm != null
                            ? maker.QualIdent(superclassElm)
                            : maker.Identifier(superclassName);
                        ClassTree copy = maker.Class(
                            orig.getModifiers(),
                            orig.getSimpleName(),
                            orig.getTypeParameters(),
                            extendsTree,
                            orig.getImplementsClause(),
                            orig.getMembers());
                        wcopy.rewrite(orig, copy);
                        break;
                    }
                }
            }
        }).commit();
    }

    template.setAttribute("justCreatedByNewWizard", Boolean.TRUE); // NOI18N
    
    return set;
}
 
Example 17
Project: incubator-netbeans   File: Evaluator.java   Source Code and License Vote up 4 votes
private void computeTestType(String ttName, File testDistDir, Set<TestModuleDependency> ttModules, Map<String,TestClasspath> classpaths, ModuleList ml) {
        final Set<String> compileCnbs = new HashSet<String>();
        final Set<String> runtimeCnbs = new HashSet<String>();
        final Set<String> testCompileCnbs = new HashSet<String>();
        final Set<String> testRuntimeCnbs = new HashSet<String>();
        Logger logger = Logger.getLogger(Evaluator.class.getName());
        // maps CNB->status: FALSE - added only to runtime CP, TRUE - added to compile CP too,
        // null - not processed (yet)
        Map<String, Boolean> processedRecursive = new HashMap<String, Boolean>();

        // #139339: optimization using processedRecursive set was too bold, removed
        for (TestModuleDependency td : ttModules) {
            String cnb = td.getModule().getCodeNameBase();
            logger.log(Level.FINE, "computeTestType: processing ''{0}''", cnb);
            if (td.isRecursive()) {
                // scan cp recursively
                Set<String> unprocessed = new HashSet<String>();

                final String codeNameBase = project.getCodeNameBase();
                unprocessed.add(td.getModule().getCodeNameBase());
                while (!unprocessed.isEmpty()) { // crude breadth-first search
                    Iterator<String> it = unprocessed.iterator();
                    String recursiveCNB = it.next();
                    it.remove();

                    // if we've put recursiveCNB module only to runtime CP and now should be also added to compile CP, process once more
                    Boolean alreadyInCompileCP = processedRecursive.get(recursiveCNB);
                    if (Boolean.TRUE.equals(alreadyInCompileCP)
                            || (Boolean.FALSE.equals(alreadyInCompileCP) && ! td.isCompile())) {
                        continue;
                    }

                    logger.log(Level.FINE, "computeTestType: processing ''{0}''", recursiveCNB);
                    ModuleEntry module = ml.getEntry(recursiveCNB);
                    if (module == null) {
                        Util.err.log(ErrorManager.WARNING, "Warning - could not find dependent module " + recursiveCNB + " for " + FileUtil.getFileDisplayName(project.getProjectDirectory()));
                        continue;
                    }
                    if (!recursiveCNB.equals(codeNameBase)) { // build/classes for this is special
//                       XXX clb.callback(td, cnb);
                        runtimeCnbs.add(recursiveCNB);
                        if (td.isCompile()) {
                            compileCnbs.add(recursiveCNB);
                        }
                        processedRecursive.put(recursiveCNB, td.isCompile());
                    }
                    String[] newDeps = module.getRunDependencies();
                    unprocessed.addAll(Arrays.asList(newDeps));
                }
//             XXX   processTestEntryRecursive(td,
//                        new Callback() {
//                            public void callback(TestModuleDependency td, String cnb) {
//                            }
//                        }, ml);
            } else {
                runtimeCnbs.add(cnb);
                if (td.isCompile()) {
                    compileCnbs.add(cnb);
                }
            }
            if (td.isTest()) {
                if (td.isCompile()) {
                    testCompileCnbs.add(cnb);
                }
                testRuntimeCnbs.add(cnb);
            }
        }

        StringBuilder extra = new StringBuilder();
        TestClasspath testClasspath = new TestClasspath(
                mergePaths(compileCnbs,false,ttName,testDistDir, ml) + extra,
                mergePaths(runtimeCnbs,false,ttName,testDistDir,ml) + extra,
                mergePaths(testCompileCnbs,true,ttName,testDistDir,ml),
                mergePaths(testRuntimeCnbs,true,ttName,testDistDir,ml));

        classpaths.put(ttName,testClasspath);
    }
 
Example 18
Project: incubator-netbeans   File: ProcessUtils.java   Source Code and License Vote up 4 votes
private static void logErrorImpl(final Level logLevel, final Logger log, List<String> err) throws IOException {
    for (String line : err) {
        log.log(logLevel, "ERROR: {0}", line); // NOI18N
    }
}
 
Example 19
Project: openjdk-jdk10   File: TestInferCaller.java   Source Code and License Vote up 4 votes
void test2(Logger logger) {
    AtomicInteger count = new AtomicInteger();
    assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
    logger.setLevel(Level.ALL);
    assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");

    for (Level l : Arrays.asList(Level.SEVERE, Level.WARNING, Level.INFO,
            Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST)) {
        System.out.println("test2: " + loggerName(logger) + " " + l);
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");

        logger.log(l, "message " + count.incrementAndGet());
        assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: ");
        LogEvent event = TestHandler.PUBLISHED.remove();
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
        checkEvent(event, this.getClass().getName(), "test2", "message " + count.get());

        logger.log(l, "message " + count.incrementAndGet(), "param");
        assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: ");
        event = TestHandler.PUBLISHED.remove();
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
        checkEvent(event, this.getClass().getName(), "test2", "message " + count.get());

        logger.log(l, "message " + count.incrementAndGet(), new Object[] {"foo", "bar"});
        assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: ");
        event = TestHandler.PUBLISHED.remove();
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
        checkEvent(event, this.getClass().getName(), "test2", "message " + count.get());

        logger.log(l, "message " + count.incrementAndGet(), new RuntimeException());
        assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: ");
        event = TestHandler.PUBLISHED.remove();
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
        checkEvent(event, this.getClass().getName(), "test2", "message " + count.get());

        // JDK 8 & 9 only (uses lambda)
        logger.log(l, () -> "message " + count.incrementAndGet());
        assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: ");
        event = TestHandler.PUBLISHED.remove();
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
        checkEvent(event, this.getClass().getName(), "test2", "message " + count.get());

        // JDK 8 & 9 only (uses lambda)
        logger.log(l, new RuntimeException(), () -> "message " + count.incrementAndGet());
        assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: ");
        event = TestHandler.PUBLISHED.remove();
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
        checkEvent(event, this.getClass().getName(), "test2", "message " + count.get());

        // JDK 9 only: new API
        logger.logrb(l, (ResourceBundle)null, "message " + count.incrementAndGet(), (Object[]) null);
        assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: ");
        event = TestHandler.PUBLISHED.remove();
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
        checkEvent(event, this.getClass().getName(), "test2", "message " + count.get());

        // JDK 9 only: new API
        logger.logrb(l, (ResourceBundle)null, "message " + count.incrementAndGet(), new RuntimeException());
        assertEquals(1, TestHandler.PUBLISHED.size(), "No event in queue: ");
        event = TestHandler.PUBLISHED.remove();
        assertEquals(0, TestHandler.PUBLISHED.size(), "Queue should be empty: ");
        checkEvent(event, this.getClass().getName(), "test2", "message " + count.get());

    }
}
 
Example 20
Project: incubator-netbeans   File: SimpleExtBrowserImpl.java   Source Code and License Vote up 4 votes
private static void logInfo(Exception ex) {
    Logger logger = Logger.getLogger(SimpleExtBrowserImpl.class.getName());
    logger.log(Level.INFO, null, ex);
}