本文整理汇总了Java中java.util.logging.Level.FINEST属性的典型用法代码示例。如果您正苦于以下问题:Java Level.FINEST属性的具体用法?Java Level.FINEST怎么用?Java Level.FINEST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.util.logging.Level
的用法示例。
在下文中一共展示了Level.FINEST属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLog
/**
* Access log for a tri-state system property.
*
* Need to first convert override value to a log level, taking
* care to interpret a range of values between BRIEF, VERBOSE and
* SILENT.
*
* An override {@literal <} 0 is interpreted to mean that the logging
* configuration should not be overridden. The level passed to the
* factories createLog method will be null in this case.
*
* Note that if oldLogName is null and old logging is on, the
* returned LogStreamLog will ignore the override parameter - the
* log will never log messages. This permits new logs that only
* write to Loggers to do nothing when old logging is active.
*
* Do not call getLog multiple times on the same logger name.
* Since this is an internal API, no checks are made to ensure
* that multiple logs do not exist for the same logger.
*/
public static Log getLog(String loggerName, String oldLogName,
int override)
{
Level level;
if (override < 0) {
level = null;
} else if (override == LogStream.SILENT) {
level = Level.OFF;
} else if ((override > LogStream.SILENT) &&
(override <= LogStream.BRIEF)) {
level = BRIEF;
} else if ((override > LogStream.BRIEF) &&
(override <= LogStream.VERBOSE))
{
level = VERBOSE;
} else {
level = Level.FINEST;
}
return logFactory.createLog(loggerName, oldLogName, level);
}
示例2: createFolder
private void createFolder(final File folder2Create, final String name) throws IOException {
boolean isSupported = new FileInfo(folder2Create).isSupportedFile();
ProvidedExtensions extensions = getProvidedExtensions();
if (!isSupported) {
extensions.createFailure(this, folder2Create.getName(), true);
FSException.io("EXC_CannotCreateFolder", folder2Create.getName(), getPath());// NOI18N
} else if (FileChangedManager.getInstance().exists(folder2Create)) {
extensions.createFailure(this, folder2Create.getName(), true);
SyncFailedException sfe = new SyncFailedException(folder2Create.getAbsolutePath()); // NOI18N
String msg = NbBundle.getMessage(FileBasedFileSystem.class, "EXC_CannotCreateFolder", folder2Create.getName(), getPath()); // NOI18N
Exceptions.attachLocalizedMessage(sfe, msg);
throw sfe;
} else if (!folder2Create.mkdirs()) {
extensions.createFailure(this, folder2Create.getName(), true);
FSException.io("EXC_CannotCreateFolder", folder2Create.getName(), getPath());// NOI18N
}
LogRecord r = new LogRecord(Level.FINEST, "FolderCreated: "+ folder2Create.getAbsolutePath());
r.setParameters(new Object[] {folder2Create});
Logger.getLogger("org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj").log(r);
}
示例3: traceOutput
protected static final void traceOutput(String srcClass, String srcMethod,
String traceTag, byte[] output, int offset, int len) {
try {
int origlen = len;
Level lev;
if (!logger.isLoggable(Level.FINEST)) {
len = Math.min(16, len);
lev = Level.FINER;
} else {
lev = Level.FINEST;
}
String content;
if (output != null) {
ByteArrayOutputStream out = new ByteArrayOutputStream(len);
new HexDumpEncoder().encodeBuffer(
new ByteArrayInputStream(output, offset, len), out);
content = out.toString();
} else {
content = "NULL";
}
// Message id supplied by caller as part of traceTag
logger.logp(lev, srcClass, srcMethod, "{0} ( {1} ): {2}",
new Object[] {traceTag, new Integer(origlen), content});
} catch (Exception e) {
logger.logp(Level.WARNING, srcClass, srcMethod,
"SASLIMPL09:Error generating trace output: {0}", e);
}
}
示例4: getLevel
private static Level getLevel(LogLevel level) {
Level l = Level.INFO;
switch (level) {
case ALL:
l = Level.ALL;
break;
case DEBUG:
l = Level.FINEST;
break;
case ERR:
l = Level.SEVERE;
break;
case FINE:
l = Level.FINE;
break;
case FINER:
l = Level.FINER;
break;
case INFO:
l = Level.INFO;
break;
case WARNING:
l = Level.WARNING;
break;
default:
l = Level.INFO;
break;
}
return l;
}
示例5: log
@Override
public void log(Level level, String message) {
if (level == Level.FINEST && !debug) {
return;
}
if (level == Level.FINEST) {
plugin.logger.debug(message);
} else if (level == Level.WARNING) {
plugin.logger.warn(message);
} else {
plugin.logger.info(message);
}
}
示例6: traceOutput
protected static final void traceOutput(String srcClass, String srcMethod,
String traceTag, byte[] output, int offset, int len) {
try {
int origlen = len;
Level lev;
if (!logger.isLoggable(Level.FINEST)) {
len = Math.min(16, len);
lev = Level.FINER;
} else {
lev = Level.FINEST;
}
String content;
if (output != null) {
ByteArrayOutputStream out = new ByteArrayOutputStream(len);
new HexDumpEncoder().encodeBuffer(
new ByteArrayInputStream(output, offset, len), out);
content = out.toString();
} else {
content = "NULL";
}
// Message id supplied by caller as part of traceTag
logger.logp(lev, srcClass, srcMethod, "{0} ( {1} ): {2}",
new Object[] {traceTag, origlen, content});
} catch (Exception e) {
logger.logp(Level.WARNING, srcClass, srcMethod,
"SASLIMPL09:Error generating trace output: {0}", e);
}
}
示例7: logLevel
@Override
protected Level logLevel() {
String[] testsWithEnabledLogger = new String[] {
"testCreateFolder72617",
"testCreateData72617",
".testBug127256"
};
return (Arrays.asList(testsWithEnabledLogger).contains(getName())) ?
Level.FINEST : Level.OFF;
}
示例8: getLevel
@Override
public Level getLevel() {
return Level.FINEST;
}
示例9: logLevel
protected @Override Level logLevel() {
return Level.FINEST;
}
示例10: logLevel
@Override
protected Level logLevel() {
return Level.FINEST;
}
示例11: run
@Override
public void run() {
try {
handler.setLevel(Level.FINEST);
while (goOn) {
Logger l;
Logger foo = Logger.getLogger("foo");
Logger bar = Logger.getLogger("foo.bar");
for (long i=0; i < nextLong.longValue() + 100 ; i++) {
if (!goOn) break;
l = Logger.getLogger("foo.bar.l"+i);
final ResourceBundle b = l.getResourceBundle();
final String name = l.getResourceBundleName();
if (b != null) {
if (!name.equals(b.getBaseBundleName())) {
throw new RuntimeException("Unexpected bundle name: "
+b.getBaseBundleName());
}
}
Logger ll = Logger.getLogger(l.getName()+".bie.bye");
ResourceBundle hrb;
String hrbName;
if (handler.getLevel() != Level.FINEST) {
throw new RuntimeException("Handler level is not finest: "
+ handler.getLevel());
}
final int countBefore = handler.count;
handler.reset();
ll.setLevel(Level.FINEST);
ll.addHandler(handler);
ll.log(Level.FINE, "dummy {0}", this);
ll.removeHandler(handler);
final int countAfter = handler.count;
if (countBefore == countAfter) {
throw new RuntimeException("Handler not called for "
+ ll.getName() + "("+ countAfter +")");
}
hrb = handler.rb;
hrbName = handler.rbName;
if (name != null) {
// if name is not null, then it implies that it
// won't change, since setResourceBundle() cannot
// replace a non null name.
// Since we never set the resource bundle on 'll',
// then ll must inherit its resource bundle [name]
// from l - and therefor we should find it in
// handler.rb/handler.rbName
if (!name.equals(hrbName)) {
throw new RuntimeException("Unexpected bundle name: "
+hrbName);
}
// here we know that hrbName is not null so hrb
// should not be null either.
if (!name.equals(hrb.getBaseBundleName())) {
throw new RuntimeException("Unexpected bundle name: "
+hrb.getBaseBundleName());
}
}
// Make sure to refer to 'l' explicitly in order to
// prevent eager garbage collecting before the end of
// the test (JDK-8030192)
if (!ll.getName().startsWith(l.getName())) {
throw new RuntimeException("Logger " + ll.getName()
+ "does not start with expected prefix "
+ l.getName());
}
getRBcount.incrementAndGet();
if (!goOn) break;
Thread.sleep(1);
}
}
} catch (Exception x) {
fail(x);
}
}
示例12: MP3Info
public MP3Info(InputStream input, long fileLength) throws IOException, ID3v2Exception, MP3Exception {
this(input, fileLength, Level.FINEST);
}
示例13: M4AInfo
public M4AInfo(InputStream input) throws IOException {
this(input, Level.FINEST);
}
示例14: getLevel
@Override
public Level getLevel() {
return willLog() ? Level.FINEST : Level.OFF;
}