List of usage examples for java.util.logging Level ALL
Level ALL
To view the source code for java.util.logging Level ALL.
Click Source Link
From source file:uk.co.propter.sleeponlan.SleepService.java
private void makeLogger() { logger = Logger.getLogger(SleepService.class.getName()); logger.setLevel(Level.ALL); }
From source file:ste.xtest.logging.BugFreeLoggingByteArrayOutputStream.java
@Test public void constructor_arguments() { ///*from w w w. j av a 2s. co m*/ // logger // try { new LoggingByteArrayOutputStream(null, Level.ALL, 1000); fail("missing argument validation"); } catch (IllegalArgumentException x) { then(x).hasMessageContaining("logger can not be null"); } Logger log = Logger.getAnonymousLogger(); LoggingByteArrayOutputStream o = new LoggingByteArrayOutputStream(log, Level.ALL, 1000); then(o.getLogger()).isSameAs(log); log = Logger.getLogger("ste.xtest"); o = new LoggingByteArrayOutputStream(log, Level.ALL, 1000); then(o.getLogger()).isSameAs(log); // // level // try { new LoggingByteArrayOutputStream(Logger.getAnonymousLogger(), null, 1000); fail("missing argument validation"); } catch (IllegalArgumentException x) { then(x).hasMessageContaining("level can not be null"); } o = new LoggingByteArrayOutputStream(log, Level.ALL, 1000); then(o.getLevel()).isSameAs(Level.ALL); o = new LoggingByteArrayOutputStream(log, Level.INFO, 1000); then(o.getLevel()).isSameAs(Level.INFO); // // maxBytes // try { new LoggingByteArrayOutputStream(Logger.getAnonymousLogger(), Level.ALL, -1); fail("missing argument validation"); } catch (IllegalArgumentException x) { then(x).hasMessageContaining("maxBytes can not be negative"); } o = new LoggingByteArrayOutputStream(log, Level.ALL, 1); then(o.getMaxBytes()).isEqualTo(1); }
From source file:com.screenslicer.common.Log.java
public static void init(String loggerName, boolean allowFileLogging) { logger = Logger.getLogger(loggerName); if (allowFileLogging) { FileHandler fh = null;/*from w w w.ja v a 2s. c om*/ try { fh = new FileHandler("../" + loggerName + ".log", 250000, 9, true); logger.addHandler(fh); String logLevel = System.getProperty("screenslicer-logging", "prod"); if (logLevel.equals("prod")) { logger.setLevel(Level.INFO); } else if (logLevel.equals("debug")) { logger.setLevel(Level.ALL); } SimpleFormatter formatter = new SimpleFormatter(); fh.setFormatter(formatter); } catch (Throwable t) { t.printStackTrace(); throw new RuntimeException(t); } } }
From source file:de.akquinet.android.rindirect.Main.java
/** * Configures the RIndirect instance.//from w ww.j a v a 2 s .c om * @param cmd the command line * @return a configured rindirect instance * @throws ParseException if the command line parameter are incorrect */ private static RIndirect configure(CommandLine cmd) throws ParseException { boolean verbose = cmd.hasOption('V'); if (verbose) { LOGGER.setLevel(Level.ALL); } File dest = new File(cmd.getOptionValue('D', "src")); if (!dest.exists()) { if (!dest.mkdirs()) { throw new ParseException("Cannot create destination directory " + dest.getAbsolutePath()); } } else if (!dest.isDirectory()) { throw new ParseException(dest.getAbsolutePath() + " is not a directory"); } LOGGER.info("Destination root : " + dest.getAbsolutePath()); String packageName = cmd.getOptionValue('P'); if (packageName == null) { throw new ParseException("Missing destination package name"); } File packageFile = new File(dest, packageName.replace(".", "/")); if (!packageFile.exists()) { if (!packageFile.mkdirs()) { throw new ParseException("Cannot create packages " + packageFile.getAbsolutePath()); } } else if (!packageFile.isDirectory()) { throw new ParseException(packageFile.getAbsolutePath() + " is not a directory"); } LOGGER.info("Package Name : " + packageName); LOGGER.info("Package File : " + packageFile.getAbsolutePath()); String className = cmd.getOptionValue('R', "R"); File classFile = new File(packageFile, className + ".java"); LOGGER.info("Java Class Name : " + className); LOGGER.info("Java Class File : " + classFile.getAbsolutePath()); if (classFile.exists() && !classFile.isFile()) { throw new ParseException(classFile.getAbsolutePath() + " is a directory - cannot be written"); } File rFile = null; if (cmd.hasOption('I')) { rFile = new File(cmd.getOptionValue('I')); if (!rFile.exists()) { throw new ParseException("The given R file (" + rFile.getAbsolutePath() + ") does not exist"); } } else { LOGGER.fine("Traverse the 'gen' directory to find the R.java file"); File gen = new File("gen"); if (!gen.exists()) { throw new ParseException("Cannot find the 'gen' folder"); } else { // Traverse gen to find R rFile = findR(gen); if (rFile == null) { throw new ParseException("Cannot find the R file in the 'gen' folder"); } } } LOGGER.info("Input R file : " + rFile.getAbsolutePath()); return new RIndirect(dest, packageName, packageFile, className, classFile, rFile); }
From source file:turtlekit.pvequalsnrt.PhysicsChecker.java
/** * Just to do some initialization work/*from w w w . ja v a2s . co m*/ */ @Override protected void activate() { setLogLevel(Level.ALL); super.activate(); wallX = Integer.parseInt(getMadkitProperty("wallX")); p = new Probe<>(getCommunity(), TKOrganization.TURTLES_GROUP, TKOrganization.TURTLE_ROLE); addProbe(p); }
From source file:turtlekit.murmuration.SpeedChecker.java
/** * Just to do some initialization work/*from w w w. j a va2 s. co m*/ */ @Override protected void activate() { setLogLevel(Level.ALL); super.activate(); probeSpeed = new PropertyProbe<AbstractStarling, Double>(getCommunity(), TKOrganization.TURTLES_GROUP, TKOrganization.TURTLE_ROLE, "speed"); addProbe(probeSpeed); }
From source file:turtlekit.murmuration.HeadingChecker.java
/** * Just to do some initialization work//from w w w . j a v a 2 s . c o m */ @Override protected void activate() { setLogLevel(Level.ALL); super.activate(); probeHeading = new PropertyProbe<AbstractStarling, Double>(getCommunity(), TKOrganization.TURTLES_GROUP, TKOrganization.TURTLE_ROLE, "angle"); addProbe(probeHeading); }
From source file:org.valabs.odisp.standart.ConfigurationManager.java
public ConfigurationManager() { log.setLevel(Level.ALL); }
From source file:org.jretty.log.Jdk14Logger.java
public static Level getLevel() { if (LogManager.getThreshold().equals(org.jretty.log.Level.FATAL) || LogManager.getThreshold().equals(org.jretty.log.Level.ERROR)) { return Level.SEVERE; }/* w w w.ja va 2s . co m*/ if (LogManager.getThreshold().equals(org.jretty.log.Level.WARN)) { return Level.WARNING; } if (LogManager.getThreshold().equals(org.jretty.log.Level.INFO)) { return Level.INFO; } if (LogManager.getThreshold().equals(org.jretty.log.Level.DEBUG)) { return Level.FINE; } if (LogManager.getThreshold().equals(org.jretty.log.Level.TRACE)) { return Level.FINEST; } if (LogManager.getThreshold().equals(org.jretty.log.Level.ALL)) { return Level.ALL; } if (LogManager.getThreshold().equals(org.jretty.log.Level.OFF)) { return Level.OFF; } return Level.INFO; }
From source file:net.openhft.chronicle.logger.jul.JulTestBase.java
protected static void log(Logger logger, ChronicleLogLevel level, String fmt, Object... args) { switch (level) { case TRACE://from www . ja va 2s .co m logger.log(Level.ALL, fmt, args); break; case DEBUG: logger.log(Level.FINE, fmt, args); break; case INFO: logger.log(Level.INFO, fmt, args); break; case WARN: logger.log(Level.WARNING, fmt, args); break; case ERROR: logger.log(Level.SEVERE, fmt, args); break; default: throw new UnsupportedOperationException(); } }