Java Code Examples for java.util.logging.Level#ALL

The following examples show how to use java.util.logging.Level#ALL . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: birt   File: JavaUtilLoggerImpl.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private static Level toJavaUtilLevel( int chartLevel )
{
	if ( chartLevel <= ILogger.ALL )
	{
		return Level.ALL;
	}
	if ( chartLevel <= ILogger.TRACE )
	{
		return Level.FINER;
	}
	if ( chartLevel <= ILogger.INFORMATION )
	{
		return Level.INFO;
	}
	if ( chartLevel <= ILogger.WARNING )
	{
		return Level.WARNING;
	}

	// Default to SEVERE.
	return Level.SEVERE;
}
 
Example 2
@Test
public void testErrorHandler() {
    ConsistentLogAndContinueErrorHandler handler = new ConsistentLogAndContinueErrorHandler(Level.ALL);
    ConsistentLogAndContinueErrorHandler returned = initConsistentErrorHandler(memcache, handler);

    ConsistentLogAndContinueErrorHandler asyncHandler = new ConsistentLogAndContinueErrorHandler(Level.ALL);
    ConsistentLogAndContinueErrorHandler asyncReturned = initConsistentErrorHandler(asyncMemcache, asyncHandler);

    assertTrue(handler.equals(returned));
    assertTrue(asyncHandler.equals(asyncReturned));

    int recordSize = (1024 * 1024) * 2;  // 2MB which should fail.
    byte[] filledRec = new byte[recordSize];
    Arrays.fill(filledRec, (byte) 0x41);

    // MemcacheServiceException should not surface to the test.
    memcache.put("BiggerThanOneMBValue", filledRec);
    asyncMemcache.put("BiggerThanOneMBValue", filledRec);
}
 
Example 3
Source Project: git-client-plugin   File: GitAPITestCase.java    License: MIT License 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
    revParseBranchName = null;
    setTimeoutVisibleInCurrentTest(true);
    checkoutTimeout = -1;
    cloneTimeout = -1;
    fetchTimeout = -1;
    submoduleUpdateTimeout = -1;
    Logger logger = Logger.getLogger(this.getClass().getPackage().getName() + "-" + logCount++);
    handler = new LogHandler();
    handler.setLevel(Level.ALL);
    logger.setUseParentHandlers(false);
    logger.addHandler(handler);
    logger.setLevel(Level.ALL);
    listener = new hudson.util.LogTaskListener(logger, Level.ALL);
    listener.getLogger().println(LOGGING_STARTED);
    w = new WorkingArea();
}
 
Example 4
Source Project: marathonv5   File: JavaServer.java    License: Apache License 2.0 5 votes vote down vote up
private Level getLogLevel(JSONObject query) {
    JSONObject prefs;
    if (query.has("requiredCapabilities") && query.getJSONObject("requiredCapabilities").has("loggingPrefs")) {
        prefs = query.getJSONObject("requiredCapabilities").getJSONObject("loggingPrefs");
    } else if (query.has("desiredCapabilities") && query.getJSONObject("desiredCapabilities").has("loggingPrefs")) {
        prefs = query.getJSONObject("desiredCapabilities").getJSONObject("loggingPrefs");
    } else {
        return Level.ALL;
    }
    if (prefs.has("driver")) {
        return Level.parse(prefs.getString("driver"));
    }
    return Level.ALL;
}
 
Example 5
Source Project: git-client-plugin   File: GitClientCloneTest.java    License: MIT License 5 votes vote down vote up
@Before
public void setUpRepositories() throws Exception {
    Logger logger = Logger.getLogger(this.getClass().getPackage().getName() + "-" + logCount++);
    handler = new LogHandler();
    handler.setLevel(Level.ALL);
    logger.setUseParentHandlers(false);
    logger.addHandler(handler);
    logger.setLevel(Level.ALL);
    listener = new hudson.util.LogTaskListener(logger, Level.ALL);

    workspace = new WorkspaceWithRepo(repo.getRoot(), gitImplName, listener);
    testGitClient = workspace.getGitClient();
    testGitDir = workspace.getGitFileDir();
}
 
Example 6
Source Project: uavstack   File: PLogger.java    License: Apache License 2.0 5 votes vote down vote up
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;
    }
 
Example 7
Source Project: gemfirexd-oss   File: ClientSharedUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static void initLog4J(String logFile,
    Level level) throws IOException {
  // set the log file location
  Properties props = new Properties();
  InputStream in = ClientSharedUtils.class.getResourceAsStream(
      "/store-log4j.properties");
  try {
    props.load(in);
  } finally {
    in.close();
  }

  // override file location and level
  if (level != null) {
    String levelStr = "INFO";
    // convert to log4j level
    if (level == Level.SEVERE) {
      levelStr = "ERROR";
    } else if (level == Level.WARNING) {
      levelStr = "WARN";
    } else if (level == Level.INFO || level == Level.CONFIG) {
      levelStr = "INFO";
    } else if (level == Level.FINE || level == Level.FINER ||
        level == Level.FINEST) {
      levelStr = "TRACE";
    } else if (level == Level.ALL) {
      levelStr = "DEBUG";
    } else if (level == Level.OFF) {
      levelStr = "OFF";
    }
    if (logFile != null) {
      props.setProperty("log4j.rootCategory", levelStr + ", file");
    } else {
      props.setProperty("log4j.rootCategory", levelStr + ", console");
    }
  }
  if (logFile != null) {
    props.setProperty("log4j.appender.file.file", logFile);
  }
  // lastly override with any user provided properties file
  in = ClientSharedUtils.class.getResourceAsStream("/log4j.properties");
  if (in != null) {
    Properties setProps = new Properties();
    try {
      setProps.load(in);
    } finally {
      in.close();
    }
    props.putAll(setProps);
  }
  LogManager.resetConfiguration();
  PropertyConfigurator.configure(props);
}
 
Example 8
Source Project: quarkus   File: InitialConfigurator.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Level getLevelOf(final String loggerName) {
    return loggerName.isEmpty() ? Level.ALL : null;
}
 
Example 9
Source Project: netbeans   File: IssueTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 10
Source Project: netbeans   File: IssueTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 11
Source Project: netbeans   File: NbClipboardNativeTest.java    License: Apache License 2.0 4 votes vote down vote up
protected Level logLevel() {
    return Level.ALL;
}
 
Example 12
Source Project: netbeans   File: QueryRefreshTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 13
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 14
GitClient cloneRepo() throws InterruptedException, IOException {
    EnvVars environment = new EnvVars();
    TaskListener taskListener = new LogTaskListener(Logger.getAnonymousLogger(), Level.ALL);
    String gitExe = gitTool.getGitExe();
    GitClient git = Git.with(taskListener, environment)
            .in(repositoryPath)
            .using(gitExe)
            .getClient();

    git.addCredentials(gitSource.getRemote(), getCredential());

    try {
        git.clone(gitSource.getRemote(), "origin", true, null);

        log.fine("Repository " + gitSource.getRemote() + " cloned to: " + repositoryPath.getCanonicalPath());
    } catch(GitException e) {
        // check if this is an empty repository
        boolean isEmptyRepo = false;
        try {
            if (git.getRemoteReferences(gitSource.getRemote(), null, true, false).isEmpty()) {
                isEmptyRepo = true;
            }
        } catch(GitException ge) {
            // *sigh* @ this necessary hack; {@link org.jenkinsci.plugins.gitclient.CliGitAPIImpl#getRemoteReferences}
            if ("unexpected ls-remote output ".equals(ge.getMessage())) { // blank line, command succeeded
                isEmptyRepo = true;
            }
            // ignore other reasons
        }

        if(isEmptyRepo) {
            git.init();
            git.addRemoteUrl("origin", gitSource.getRemote());

            log.fine("Repository " + gitSource.getRemote() + " not found, created new to: " + repositoryPath.getCanonicalPath());
        } else {
            throw e;
        }
    }

    return git;
}
 
Example 15
Source Project: netbeans   File: SvnHookTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 16
Source Project: netbeans   File: RepositoryTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 17
Source Project: netbeans   File: LazyNodeTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 18
Source Project: netbeans   File: OpenIssueTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 19
Source Project: netbeans   File: QueryTest.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected Level logLevel() {
    return Level.ALL;
}
 
Example 20
private DetailsLogRecord(Instance rec, Heap h) {
    super(Level.ALL, null);
    record = rec;
    heap = h;
}