本文整理汇总了Java中java.util.logging.Level.FINE属性的典型用法代码示例。如果您正苦于以下问题:Java Level.FINE属性的具体用法?Java Level.FINE怎么用?Java Level.FINE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.util.logging.Level
的用法示例。
在下文中一共展示了Level.FINE属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInputStream
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;
}
示例2: convertSeverity
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;
}
示例3: warnIfNotInEDT
/** 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"));
}
}
}
示例4: logLevel
@Override
protected Level logLevel() {
// return Level.FINEST;
// return Level.FINE;
// return Level.INFO;
return Level.FINE;
}
示例5: CommandProcess
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);
}
}
示例6: sendBuildFromJob
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);
}
}
示例7: randomLevel
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;
}
示例8: testSomeNPE
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);
}
示例9: logLevel
@Override
protected Level logLevel() {
return Level.FINE;
}
示例10: getSevereProblemLogLevel
final Level getSevereProblemLogLevel() {
return LanguageProviderFactory.get().getBaseLanguage() == parser.getDictionary().getLanguage() ? Level.SEVERE : Level.FINE; // TODO: This should turn into INFO for other langs;
}
示例11: logLevel
protected Level logLevel() {
return Level.FINE;
}
示例12: logLevel
@Override protected Level logLevel() {
return Level.FINE;
}