Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejuvenate log levels #2978

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void close() {
IOUtils.close(ctagsIn);
if (ctags != null) {
closing = true;
LOGGER.log(Level.FINE, "Destroying ctags command");
LOGGER.log(Level.FINER, "Destroying ctags command");
ctags.destroyForcibly();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void load(Map<String, Object> parameters) {
getCurrentSetup().putAll(parameters);
getCurrentSetup().putAll(getSetup());

LOGGER.log(Level.INFO, "[{0}] Stack \"{1}\" is loading.",
LOGGER.log(Level.FINE, "[{0}] Stack \"{1}\" is loading.",
new Object[]{getFlag().toString().toUpperCase(Locale.ROOT),
getName()});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ public void applyConfig(String configuration, boolean reindex, boolean interacti
*/
public void applyConfig(Configuration config, boolean reindex, boolean interactive) {
setConfiguration(config, interactive);
LOGGER.log(Level.INFO, "Configuration updated");
LOGGER.log(Level.FINE, "Configuration updated");

if (reindex) {
// We are assuming that each update of configuration means reindex. If dedicated thread is introduced
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public boolean accept(File dir, String name) {
try (InputStream is = jar.getInputStream(entry)) {
byte[] bytes = loadBytes(is);
Class c = defineClass(classname, bytes, 0, bytes.length);
LOGGER.log(Level.FINE, "Class \"{0}\" found in file \"{1}\"",
LOGGER.log(Level.FINER, "Class \"{0}\" found in file \"{1}\"",
new Object[]{
classname,
f.getAbsolutePath()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public final void reload() {
return;
}

LOGGER.log(Level.INFO, "Plugins are being reloaded from {0}", pluginDirectory.getAbsolutePath());
LOGGER.log(Level.FINE, "Plugins are being reloaded from {0}", pluginDirectory.getAbsolutePath());

// trashing out the old instance of the loaded enables us
// to reload the stack at runtime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private boolean getAccuRevInfo(File wsPath, boolean interactive) {
// from the path known by Accurev)

if (Files.isSymbolicLink(given)) {
LOGGER.log(Level.INFO, "{0} is symbolic link.", wsPath);
LOGGER.log(Level.FINE, "{0} is symbolic link.", wsPath);

// When we know that the two paths DO NOT point to the
// same place (that is, the given path is deeper into
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public void store(History history, Repository repository)
return;
}

LOGGER.log(Level.FINE,
LOGGER.log(Level.FINER,
"Storing history for repository {0}",
new Object[] {repository.getDirectoryName()});

Expand Down Expand Up @@ -490,7 +490,7 @@ public void store(History history, Repository repository)
fileHistoryCount++;
}

LOGGER.log(Level.FINE, "Stored history for {0} files", fileHistoryCount);
LOGGER.log(Level.FINER, "Stored history for {0} files", fileHistoryCount);

if (!handleRenamedFiles) {
finishStore(repository, latestRev);
Expand Down Expand Up @@ -559,7 +559,7 @@ public void store(History history, Repository repository)
} catch (InterruptedException ex) {
LOGGER.log(Level.SEVERE, "latch exception", ex);
}
LOGGER.log(Level.FINE, "Stored history for {0} renamed files",
LOGGER.log(Level.FINER, "Stored history for {0} renamed files",
renamedFileHistoryCount.intValue());
finishStore(repository, latestRev);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public void fileAdd(String path, String analyzer) {

@Override
public void fileRemove(String path) {
LOGGER.log(Level.FINE, "Remove file:{0}", path);
LOGGER.log(Level.FINER, "Remove file:{0}", path);
}
@Override
public void fileUpdate(String path) {
LOGGER.log(Level.FINE, "Update: {0}", path);
LOGGER.log(Level.FINER, "Update: {0}", path);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ public void optimize() throws IOException {
try {
Statistics elapsed = new Statistics();
String projectDetail = this.project != null ? " for project " + project.getName() : "";
LOGGER.log(Level.INFO, "Optimizing the index{0}", projectDetail);
LOGGER.log(Level.FINE, "Optimizing the index{0}", projectDetail);
Analyzer analyzer = new StandardAnalyzer();
IndexWriterConfig conf = new IndexWriterConfig(analyzer);
conf.setOpenMode(OpenMode.CREATE_OR_APPEND);
Expand Down Expand Up @@ -1700,7 +1700,7 @@ private void finishWriting() throws IOException {
hasPendingCommit = true;

int n = completer.complete();
LOGGER.log(Level.FINE, "completed {0} object(s)", n);
LOGGER.log(Level.FINER, "completed {0} object(s)", n);

// Just before commit(), reset the `hasPendingCommit' flag,
// since after commit() is called, there is no need for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,27 @@ private IndexVersion() {
public static void check(List<String> subFilesList) throws Exception {
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
File indexRoot = new File(env.getDataRootPath(), IndexDatabase.INDEX_DIR);
LOGGER.log(Level.FINE, "Checking for Lucene index version mismatch in {0}",
LOGGER.log(Level.FINER, "Checking for Lucene index version mismatch in {0}",
indexRoot);

if (!subFilesList.isEmpty()) {
// Assumes projects are enabled.
for (String projectName : subFilesList) {
LOGGER.log(Level.FINER,
LOGGER.log(Level.FINEST,
"Checking Lucene index version in project {0}",
projectName);
checkDir(new File(indexRoot, projectName));
}
} else {
if (env.isProjectsEnabled()) {
for (String projectName : env.getProjects().keySet()) {
LOGGER.log(Level.FINER,
LOGGER.log(Level.FINEST,
"Checking Lucene index version in project {0}",
projectName);
checkDir(new File(indexRoot, projectName));
}
} else {
LOGGER.log(Level.FINER, "Checking Lucene index version in {0}",
LOGGER.log(Level.FINEST, "Checking Lucene index version in {0}",
indexRoot);
checkDir(indexRoot);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ public static void writeConfigToFile(RuntimeEnvironment env, String filename) th
if (filename != null) {
LOGGER.log(Level.INFO, "Writing configuration to {0}", filename);
env.writeConfiguration(new File(filename));
LOGGER.info("Done...");
LOGGER.fine("Done...");
}
}

Expand Down Expand Up @@ -965,14 +965,14 @@ public void prepareIndexer(RuntimeEnvironment env,
if (createHistoryCache) {
// Even if history is disabled globally, it can be enabled for some repositories.
if (repositories != null && !repositories.isEmpty()) {
LOGGER.log(Level.INFO, "Generating history cache for repositories: " +
LOGGER.log(Level.FINE, "Generating history cache for repositories: " +
repositories.stream().collect(Collectors.joining(",")));
HistoryGuru.getInstance().createCache(repositories);
LOGGER.info("Done...");
LOGGER.fine("Done...");
} else {
LOGGER.log(Level.INFO, "Generating history cache for all repositories ...");
LOGGER.log(Level.FINE, "Generating history cache for all repositories ...");
HistoryGuru.getInstance().createCache();
LOGGER.info("Done...");
LOGGER.fine("Done...");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static boolean validate(String ctagsBinary) {
return false;
}

LOGGER.log(Level.INFO, "Using ctags: {0}", output.trim());
LOGGER.log(Level.FINE, "Using ctags: {0}", output.trim());

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public int exec(final boolean reportExceptions, StreamHandler handler) {
Map<String, String> env_map = processBuilder.environment();
env_str = " with environment: " + env_map.toString();
}
LOGGER.log(Level.FINE,
LOGGER.log(Level.FINER,
"Executing command [{0}] in directory {1}{2}",
new Object[] {cmd_str, dir_str, env_str});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void deleteProject(@PathParam("project") final String projectName)
public void deleteProjectData(@PathParam("project") String projectName) throws HistoryException {

Project project = disableProject(projectName);
logger.log(Level.INFO, "deleting data for project {0}", projectName);
logger.log(Level.FINE, "deleting data for project {0}", projectName);

List<RepositoryInfo> repos = env.getProjectRepositoriesMap().get(project);

Expand All @@ -204,7 +204,7 @@ public void deleteProjectData(@PathParam("project") String projectName) throws H
public void deleteHistoryCache(@PathParam("project") String projectName) throws HistoryException {

Project project = disableProject(projectName);
logger.log(Level.INFO, "deleting history cache for project {0}", projectName);
logger.log(Level.FINE, "deleting history cache for project {0}", projectName);

List<RepositoryInfo> repos = env.getProjectRepositoriesMap().get(project);
if (repos == null || repos.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private List<NamedIndexReader> getNamedIndexReaders(
/** {@inheritDoc} */
@Override
public void refresh() {
logger.log(Level.FINE, "Refreshing suggester for new configuration {0}", env.getSuggesterConfig());
logger.log(Level.FINER, "Refreshing suggester for new configuration {0}", env.getSuggesterConfig());
lock.writeLock().lock();
try {
// close and init from scratch because many things may have changed in the configuration
Expand Down Expand Up @@ -351,7 +351,7 @@ private void scheduleRebuild() {
return;
}

logger.log(Level.INFO, "Scheduling suggester rebuild in {0}", timeToNextRebuild);
logger.log(Level.FINE, "Scheduling suggester rebuild in {0}", timeToNextRebuild);

future = instance.scheduler.schedule(instance.getRebuildAllProjectsRunnable(), timeToNextRebuild.toMillis(),
TimeUnit.MILLISECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void init(Map<String, Object> parameters) {
throw new IllegalArgumentException(String.format("Unable to read the file \"%s\"", filePath), e);
}

LOGGER.log(Level.FINE, "LdapAttrPlugin plugin loaded with attr={0}, whitelist={1}, instance={2}",
LOGGER.log(Level.FINER, "LdapAttrPlugin plugin loaded with attr={0}, whitelist={1}, instance={2}",
new Object[]{ldapAttr, filePath, ldapUserInstance});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void load(Map<String, Object> parameters) {
loadTransforms(transformsString);
}

LOGGER.log(Level.FINE, "LdapFilter plugin loaded with filter={0}, instance={1}, transforms={2}",
LOGGER.log(Level.FINER, "LdapFilter plugin loaded with filter={0}, instance={1}, transforms={2}",
new Object[]{ldapFilter, ldapUserInstance, transforms});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void init(Map<String, Object> parameters) {
instance = Integer.parseInt(instance_param);
}

LOGGER.log(Level.FINE, "LdapUser plugin loaded with filter={0}, " +
LOGGER.log(Level.FINER, "LdapUser plugin loaded with filter={0}, " +
"attributes={1}, useDN={2}, instance={3}",
new Object[]{ldapFilter, attributes, useDN, instance});
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/src/main/java/opengrok/auth/plugin/UserPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void load(Map<String, Object> parameters) {
DECODER_CLASS_PARAM, UserPlugin.class.getName()));
}

LOGGER.log(Level.INFO, "loading decoder: {0}", decoder_name);
LOGGER.log(Level.FINE, "loading decoder: {0}", decoder_name);
try {
decoder = getDecoder(decoder_name);
} catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException |
Expand Down
6 changes: 3 additions & 3 deletions suggester/src/main/java/org/opengrok/suggest/Suggester.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public void rebuild(final Collection<NamedIndexDir> indexDirs) {

synchronized (lock) {
Instant start = Instant.now();
logger.log(Level.INFO, "Rebuilding the following suggesters: {0}", indexDirs);
logger.log(Level.FINE, "Rebuilding the following suggesters: {0}", indexDirs);

ExecutorService executor = Executors.newWorkStealingPool(rebuildParallelismLevel);

Expand All @@ -257,7 +257,7 @@ private Runnable getRebuildRunnable(final SuggesterProjectData data) {
return () -> {
try {
Instant start = Instant.now();
logger.log(Level.FINE, "Rebuilding {0}", data);
logger.log(Level.FINER, "Rebuilding {0}", data);
data.rebuild();

Duration d = Duration.between(start, Instant.now());
Expand All @@ -278,7 +278,7 @@ public void remove(final Iterable<String> names) {
}

synchronized (lock) {
logger.log(Level.INFO, "Removing following suggesters: {0}", names);
logger.log(Level.FINE, "Removing following suggesters: {0}", names);

for (String suggesterName : names) {
SuggesterProjectData collection = projectData.get(suggesterName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private double getAverageLength(final String field) {
if (averageLengths.containsKey(field)) {
return averageLengths.get(field);
}
logger.log(Level.FINE, "Could not determine average length for field {0}, using default one", field);
logger.log(Level.FINER, "Could not determine average length for field {0}, using default one", field);
return AVERAGE_LENGTH_DEFAULT;
}

Expand Down