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

The following are Jave code examples for showing how to use FINE 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: incubator-netbeans   File: MIMESupport.java   View Source Code Vote up 6 votes
public InputStream getInputStream() throws java.io.FileNotFoundException {
    if (fixIt == null) {
        if (ERR.isLoggable(Level.FINE)) {
            LogRecord rec = new LogRecord(Level.FINE, "MSG_CACHED_INPUT_STREAM");
            rec.setParameters(new Object[] { this });
            rec.setResourceBundle(NbBundle.getBundle(MIMESupport.class));
            ERR.log(rec);
        }
        InputStream is = fileObj.getInputStream();

        fixIt = new CachedInputStream(is, fileObj);
    }

    fixIt.cacheToStart();

    return fixIt;
}
 
Example 2
Project: incubator-netbeans   File: ErrorManager.java   View Source Code Vote up 6 votes
private static Level convertSeverity(final int severity, boolean forException, Level def) {
    Level sev = def;

    if (severity >= ERROR) {
        sev = Level.SEVERE;
    } else if (severity >= EXCEPTION) {
        sev = Level.SEVERE;
    } else if (severity >= USER) {
        sev = OwnLevel.USER;
    } else if (severity >= WARNING) {
        sev = Level.WARNING;
    } else if (severity >= INFORMATIONAL) {
        sev = forException ? Level.INFO: Level.FINE;
    }
    return sev;
}
 
Example 3
Project: incubator-netbeans   File: WindowManagerImpl.java   View Source Code Vote up 5 votes
/** Weaker form of assertion to control if client's code is calling
 * winsys from ED thread. Level of logged exception is lower if
 * assertions are disabled (for releases etc).
 */
static void warnIfNotInEDT () {
    Level level = assertsEnabled ? Level.WARNING : Level.FINE;
    if(!SwingUtilities.isEventDispatchThread()) {
        // tries to catch known JDK problem, SwingUtilities.isEventDispatchThread()
        // returns false even if it *is* in ED thread.
        // if we find "java.awt.EventDispatchThread" stack line, it's probable
        // that we hit this JDK problem (see links below)
        boolean isJDKProblem = false;
        StackTraceElement[] elems = Thread.currentThread().getStackTrace();
        for (StackTraceElement elem : elems) {
            if ("java.awt.EventDispatchThread".equals(elem.getClassName())) {
                isJDKProblem = true;
                break;
            }
        }

        if (!isJDKProblem) {
            // problem somewhere in NetBeans modules' code
            Logger.getLogger(WindowManagerImpl.class.getName()).log(level, null,
                    new java.lang.IllegalStateException(
                    "Problem in some module which uses Window System: "
                    + ASSERTION_ERROR_MESSAGE));
        } else {
            // probably known problem in JDK
            Logger.getLogger(WindowManagerImpl.class.getName()).log(level, null,
                    new java.lang.IllegalStateException(
                    "Known problem in JDK occurred. If you are interested, vote and report at:\n" +
                    "http://bugs.sun.com/view_bug.do?bug_id=6424157, http://bugs.sun.com/view_bug.do?bug_id=6553239 \n" +
                    "Also see related discussion at http://www.netbeans.org/issues/show_bug.cgi?id=90590"));
        }
    }
}
 
Example 4
Project: incubator-netbeans   File: EditorDocumentContentTest.java   View Source Code Vote up 5 votes
@Override
    protected Level logLevel() {
//        return Level.FINEST;
//        return Level.FINE;
//        return Level.INFO;
        return Level.FINE;
    }
 
Example 5
Project: ios-device-control   File: CommandProcess.java   View Source Code Vote up 5 votes
protected CommandProcess(Command command, RawProcess rawProcess) throws CommandStartException {
  this.command = checkNotNull(command);
  this.rawProcess = checkNotNull(rawProcess);
  stdoutStream = new CapturingOutputStream();
  stderrStream = new CapturingOutputStream();

  Supplier<Level> ioLogLevel = new Supplier<Level>() {
    @Override
    public Level get() {
      return CommandProcess.this.rawProcess.isAlive() ? Level.WARNING : Level.FINE;
    }
  };

  try {
    stdinPump =
        maybeStartCopyFromSourceToPipe(command.stdinSource(), rawProcess.stdinPipe(), ioLogLevel);
    stdoutPump =
        maybeStartCopyFromPipeToSink(
            rawProcess.stdoutPipe(),
            command.stdoutSink(),
            stdoutStream,
            stderrStream,
            ioLogLevel);
    stderrPump =
        maybeStartCopyFromPipeToSink(
            rawProcess.stderrPipe(),
            command.stderrSink(),
            stdoutStream,
            stderrStream,
            ioLogLevel);
  } catch (IOException e) {
    throw new CommandStartException(command, e);
  }
}
 
Example 6
Project: mirrorgate-jenkins-builds-collector   File: MirrorGateListenerHelper.java   View Source Code Vote up 5 votes
public void sendBuildFromJob(Job job, TaskListener listener) {
    if (job != null && job.getLastBuild() != null) {
        BuildStatus status = job.isBuildable() ? (job.getLastBuild().getResult() != null
                ? BuildStatus.fromString(job.getLastBuild().getResult().toString())
                : BuildStatus.InProgress) : BuildStatus.Deleted;
        BuildBuilder builder = new BuildBuilder(job.getLastBuild(), status);
        MirrorGateResponse response = getMirrorGateService()
                .publishBuildData(builder.getBuildData());

        String msg;
        Level level;
        if (response.getResponseCode() == HttpStatus.SC_CREATED) {
            msg = "MirrorGate: Published Build Complete Data. " + response.toString();
            level = Level.FINE;
        } else {
            msg = "MirrorGate: Build Status could not been sent to MirrorGate. Please contact with " +
                    "MirrorGate Team for further information ([email protected]).";
            level = Level.WARNING;
        }

        if (listener != null && level == Level.FINE) {
            listener.getLogger().println("Follow this project's builds progress at: "
                    + createMirrorgateLink(builder.getBuildData().getProjectName()));

            listener.getLogger().println(msg);
        }
        LOG.log(level, msg);

        sendBuildExtraData(builder, listener);
    }
}
 
Example 7
Project: incubator-netbeans   File: LogRecordsTest.java   View Source Code Vote up 5 votes
private static Level randomLevel(Random r) {
    int lev = r.nextInt(1100);
    if (lev >= Level.SEVERE.intValue()) return Level.SEVERE;
    if (lev >= Level.WARNING.intValue()) return Level.WARNING;
    if (lev >= Level.INFO.intValue()) return Level.INFO;
    if (lev >= Level.CONFIG.intValue()) return Level.CONFIG;
    if (lev >= Level.FINE.intValue()) return Level.FINE;
    if (lev >= Level.FINER.intValue()) return Level.FINER;
    if (lev >= Level.FINEST.intValue()) return Level.FINEST;
    return Level.OFF;
}
 
Example 8
Project: incubator-netbeans   File: DecorableTest.java   View Source Code Vote up 5 votes
public void testSomeNPE() throws Exception {
    LogRecord r = new LogRecord(Level.FINE, "UI_ACTION_EDITOR");
    Node n = UINode.create(r);
    assertNotNull(n);
    assertEquals("No name", "", n.getDisplayName());
    assertNotNull(n.getName());
    assertSerializedWell(r, n);
}
 
Example 9
Project: incubator-netbeans   File: InteceptorTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}
 
Example 10
Project: grammaticus   File: GrammaticalLabelFileHandler.java   View Source Code Vote up 4 votes
final Level getSevereProblemLogLevel() {
    return LanguageProviderFactory.get().getBaseLanguage() == parser.getDictionary().getLanguage() ? Level.SEVERE : Level.FINE; // TODO: This should turn into INFO for other langs;
}
 
Example 11
Project: incubator-netbeans   File: SlowRefreshInterruptibleTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}
 
Example 12
Project: incubator-netbeans   File: AbstractHgTestCase.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}
 
Example 13
Project: incubator-netbeans   File: MIMESupport69049Test.java   View Source Code Vote up 4 votes
protected Level logLevel() {
    return Level.FINE;
}
 
Example 14
Project: incubator-netbeans   File: ToolbarConfigurationDeadlockTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}
 
Example 15
Project: incubator-netbeans   File: SingleModulePropertiesTest.java   View Source Code Vote up 4 votes
@Override protected Level logLevel() {
    return Level.FINE;
}
 
Example 16
Project: incubator-netbeans   File: Issue167725DeadlockTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}
 
Example 17
Project: incubator-netbeans   File: AbstractSvnTestCase.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}
 
Example 18
Project: incubator-netbeans   File: CacheIndexTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}
 
Example 19
Project: incubator-netbeans   File: SerialDataConvertorTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}
 
Example 20
Project: incubator-netbeans   File: ExplorerManagerTest.java   View Source Code Vote up 4 votes
@Override
protected Level logLevel() {
    return Level.FINE;
}