Skip to content

Rejuvenate logging statement levels #2754

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

Closed
wants to merge 1 commit 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 @@ -110,7 +110,7 @@ public void close() throws IOException {
IOUtils.close(ctagsIn);
if (ctags != null) {
closing = true;
LOGGER.log(Level.FINE, "Destroying ctags command");
LOGGER.log(Level.FINEST, "Destroying ctags command");
ctags.destroyForcibly();
}
}
Expand Down Expand Up @@ -178,7 +178,7 @@ private void initialize() throws IOException {

/* Add extra command line options for ctags. */
if (CTagsExtraOptionsFile != null) {
LOGGER.log(Level.INFO, "Adding extra options to ctags");
LOGGER.log(Level.FINEST, "Adding extra options to ctags");
command.add("--options=" + CTagsExtraOptionsFile);
}

Expand All @@ -187,7 +187,7 @@ private void initialize() throws IOException {
sb.append(s).append(" ");
}
String commandStr = sb.toString();
LOGGER.log(Level.FINE, "Executing ctags command [{0}]", commandStr);
LOGGER.log(Level.FINEST, "Executing ctags command [{0}]", commandStr);

processBuilder = new ProcessBuilder(command);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ public String parseELF(FileChannel fch) throws IOException {
ELFHeader eh = new ELFHeader(fmap);

if (eh.e_shnum <= 0) {
LOGGER.log(Level.FINE, "Skipping file, no section headers");
LOGGER.log(Level.FINEST, "Skipping file, no section headers");
return null;
}

fmap.position(eh.e_shoff + (eh.e_shstrndx * eh.e_shentsize));
ELFSection stringSection = new ELFSection(fmap);

if (stringSection.sh_size == 0) {
LOGGER.log(Level.FINE, "Skipping file, no section name string table");
LOGGER.log(Level.FINEST, "Skipping file, no section name string table");
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void unloadAllPlugins(AuthorizationStack stack) {
@Override
protected void classLoaded(IAuthorizationPlugin plugin) {
if (!loadingStack.setPlugin(plugin)) {
LOGGER.log(Level.INFO, "plugin {0} is not configured in the stack", plugin.getClass().getCanonicalName());
LOGGER.log(Level.FINEST, "plugin {0} is not configured in the stack", plugin.getClass().getCanonicalName());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public synchronized void load(Map<String, Object> parameters) {
+ "This can cause the authorization to fail always.",
getName());
setFailed();
LOGGER.log(Level.INFO, "[{0}] Plugin \"{1}\" {2} and is {3}.",
LOGGER.log(Level.FINEST, "[{0}] Plugin \"{1}\" {2} and is {3}.",
new Object[]{
getFlag().toString().toUpperCase(Locale.ROOT),
getName(),
Expand All @@ -125,7 +125,7 @@ public synchronized void load(Map<String, Object> parameters) {
setFailed();
}

LOGGER.log(Level.INFO, "[{0}] Plugin \"{1}\" {2} and is {3}.",
LOGGER.log(Level.FINEST, "[{0}] Plugin \"{1}\" {2} and is {3}.",
new Object[]{
getFlag().toString().toUpperCase(Locale.ROOT),
getName(),
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.FINEST, "[{0}] Stack \"{1}\" is loading.",
new Object[]{getFlag().toString().toUpperCase(Locale.ROOT),
getName()});

Expand All @@ -155,7 +155,7 @@ public void load(Map<String, Object> parameters) {
setFailed();
}

LOGGER.log(Level.INFO, "[{0}] Stack \"{1}\" is {2}.",
LOGGER.log(Level.FINEST, "[{0}] Stack \"{1}\" is {2}.",
new Object[]{
getFlag().toString().toUpperCase(Locale.ROOT),
getName(),
Expand Down Expand Up @@ -192,17 +192,17 @@ public boolean isAllowed(Nameable entity,
PluginDecisionPredicate pluginPredicate,
PluginSkippingPredicate skippingPredicate) {
boolean overallDecision = true;
LOGGER.log(Level.FINER, "Authorization for \"{0}\" in \"{1}\" [{2}]",
LOGGER.log(Level.FINEST, "Authorization for \"{0}\" in \"{1}\" [{2}]",
new Object[]{entity.getName(), this.getName(), this.getFlag()});

if (skippingPredicate.shouldSkip(this)) {
LOGGER.log(Level.FINER, "AuthEntity \"{0}\" [{1}] skipping testing of name \"{2}\"",
LOGGER.log(Level.FINEST, "AuthEntity \"{0}\" [{1}] skipping testing of name \"{2}\"",
new Object[]{this.getName(), this.getFlag(), entity.getName()});
} else {
overallDecision = processStack(entity, pluginPredicate, skippingPredicate);
}

LOGGER.log(Level.FINER, "Authorization for \"{0}\" in \"{1}\" [{2}] => {3}",
LOGGER.log(Level.FINEST, "Authorization for \"{0}\" in \"{1}\" [{2}] => {3}",
new Object[]{entity.getName(), this.getName(), this.getFlag(), overallDecision ? "true" : "false"});
return overallDecision;
}
Expand All @@ -229,18 +229,18 @@ protected boolean processStack(Nameable entity,
for (AuthorizationEntity authEntity : getStack()) {

if (skippingPredicate.shouldSkip(authEntity)) {
LOGGER.log(Level.FINEST, "AuthEntity \"{0}\" [{1}] skipping testing of name \"{2}\"",
LOGGER.log(Level.FINER, "AuthEntity \"{0}\" [{1}] skipping testing of name \"{2}\"",
new Object[]{authEntity.getName(), authEntity.getFlag(), entity.getName()});
continue;
}
// run the plugin's test method
try {
LOGGER.log(Level.FINEST, "AuthEntity \"{0}\" [{1}] testing a name \"{2}\"",
LOGGER.log(Level.FINER, "AuthEntity \"{0}\" [{1}] testing a name \"{2}\"",
new Object[]{authEntity.getName(), authEntity.getFlag(), entity.getName()});

boolean pluginDecision = authEntity.isAllowed(entity, pluginPredicate, skippingPredicate);

LOGGER.log(Level.FINEST, "AuthEntity \"{0}\" [{1}] testing a name \"{2}\" => {3}",
LOGGER.log(Level.FINER, "AuthEntity \"{0}\" [{1}] testing a name \"{2}\" => {3}",
new Object[]{authEntity.getName(), authEntity.getFlag(), entity.getName(),
pluginDecision ? "true" : "false"});

Expand All @@ -259,7 +259,7 @@ protected boolean processStack(Nameable entity,
}
} catch (AuthorizationException ex) {
// Propagate up so that proper HTTP error can be given.
LOGGER.log(Level.FINEST, "got authorization exception: " + ex.getMessage());
LOGGER.log(Level.FINER, "got authorization exception: " + ex.getMessage());
throw ex;
} catch (Throwable ex) {
LOGGER.log(Level.WARNING,
Expand All @@ -268,7 +268,7 @@ protected boolean processStack(Nameable entity,
entity.getName()),
ex);

LOGGER.log(Level.FINEST, "AuthEntity \"{0}\" [{1}] testing a name \"{2}\" => {3}",
LOGGER.log(Level.FINER, "AuthEntity \"{0}\" [{1}] testing a name \"{2}\" => {3}",
new Object[]{authEntity.getName(), authEntity.getFlag(), entity.getName(),
"false (failed)"});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ public void encodeObject(OutputStream out) {
}

public static Configuration read(File file) throws IOException {
LOGGER.log(Level.INFO, "Reading configuration from {0}", file.getCanonicalPath());
LOGGER.log(Level.FINEST, "Reading configuration from {0}", file.getCanonicalPath());
try (FileInputStream in = new FileInputStream(file)) {
return decodeObject(in);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,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.FINEST, "Configuration updated");

if (reindex) {
// We are assuming that each update of configuration means reindex. If dedicated thread is introduced
Expand Down Expand Up @@ -1751,7 +1751,7 @@ public void refreshSearcherManagerMap() {
// so that it cannot produce new IndexSearcher objects.
if (!getProjectNames().contains(entry.getKey())) {
try {
LOGGER.log(Level.FINE,
LOGGER.log(Level.FINEST,
"closing SearcherManager for project" + entry.getKey());
entry.getValue().close();
} catch (IOException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public void start(File directory) {
stop();

if (directory == null || !directory.isDirectory() || !directory.canRead()) {
LOGGER.log(Level.INFO, "Watch dog cannot be started - invalid directory: {0}", directory);
LOGGER.log(Level.FINEST, "Watch dog cannot be started - invalid directory: {0}", directory);
return;
}
LOGGER.log(Level.INFO, "Starting watchdog in: {0}", directory);
LOGGER.log(Level.FINEST, "Starting watchdog in: {0}", directory);
watchDogThread = new Thread(() -> {
try {
watchDogWatcher = FileSystems.getDefault().newWatchService();
Expand All @@ -89,7 +89,7 @@ public FileVisitResult postVisitDirectory(Path d, IOException exc) throws IOExce
}
});

LOGGER.log(Level.INFO, "Watch dog started {0}", directory);
LOGGER.log(Level.FINEST, "Watch dog started {0}", directory);
while (!Thread.currentThread().isInterrupted()) {
final WatchKey key;
try {
Expand Down Expand Up @@ -117,7 +117,7 @@ public FileVisitResult postVisitDirectory(Path d, IOException exc) throws IOExce
LOGGER.log(Level.FINEST, "Watchdog finishing (exiting)", ex);
Thread.currentThread().interrupt();
}
LOGGER.log(Level.FINER, "Watchdog finishing (exiting)");
LOGGER.log(Level.FINEST, "Watchdog finishing (exiting)");
}, "watchDogService");
watchDogThread.start();
}
Expand All @@ -141,6 +141,6 @@ public void stop() {
LOGGER.log(Level.WARNING, "Cannot join WatchDogService thread: ", ex);
}
}
LOGGER.log(Level.INFO, "Watchdog stoped");
LOGGER.log(Level.FINEST, "Watchdog stoped");
}
}
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.FINEST, "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.FINEST, "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 @@ -347,7 +347,7 @@ else if (line.startsWith("Top")) {
// from the path known by Accurev)

if (Files.isSymbolicLink(given)) {
LOGGER.log(Level.INFO,"{0} is symbolic link.", wsPath);
LOGGER.log(Level.FINEST,"{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 All @@ -372,7 +372,7 @@ else if (line.startsWith("Top")) {
}

if (relRoot.length() > 0) {
LOGGER.log(Level.INFO,"Source root relative to workspace root by: {0}", relRoot);
LOGGER.log(Level.FINEST,"Source root relative to workspace root by: {0}", relRoot);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private void finishStore(Repository repository, String latestRev) {
repository.getDirectoryName());
} else {
storeLatestCachedRevision(repository, latestRev);
LOGGER.log(Level.FINE,
LOGGER.log(Level.FINEST,
"Done storing history for repository {0}",
repository.getDirectoryName());
}
Expand Down Expand Up @@ -417,7 +417,7 @@ public void store(History history, Repository repository)
return;
}

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

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

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

if (!handleRenamedFiles) {
finishStore(repository, latestRev);
Expand Down Expand Up @@ -560,7 +560,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.FINEST, "Stored history for {0} renamed files",
renamedFileHistoryCount.intValue());
finishStore(repository, latestRev);
}
Expand Down Expand Up @@ -817,7 +817,7 @@ public void clearFile(String path) {
}

if (parent.delete()) {
LOGGER.log(Level.FINE, "Removed empty history cache dir:{0}",
LOGGER.log(Level.FINEST, "Removed empty history cache dir:{0}",
parent.getAbsolutePath());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,22 @@ public String getLine() {

public void dump() {

LOGGER.log(Level.FINE, "HistoryEntry : revision = {0}", revision);
LOGGER.log(Level.FINE, "HistoryEntry : tags = {0}", tags);
LOGGER.log(Level.FINE, "HistoryEntry : date = {0}", date);
LOGGER.log(Level.FINE, "HistoryEntry : author = {0}", author);
LOGGER.log(Level.FINE, "HistoryEntry : active = {0}", (active ?
LOGGER.log(Level.FINEST, "HistoryEntry : revision = {0}", revision);
LOGGER.log(Level.FINEST, "HistoryEntry : tags = {0}", tags);
LOGGER.log(Level.FINEST, "HistoryEntry : date = {0}", date);
LOGGER.log(Level.FINEST, "HistoryEntry : author = {0}", author);
LOGGER.log(Level.FINEST, "HistoryEntry : active = {0}", (active ?
"True" : "False"));
String[] lines = message.toString().split("\n");
String separator = "=";
for (String line : lines) {
LOGGER.log(Level.FINE, "HistoryEntry : message {0} {1}",
LOGGER.log(Level.FINEST, "HistoryEntry : message {0} {1}",
new Object[]{separator, line});
separator = ">";
}
separator = "=";
for (String file : files) {
LOGGER.log(Level.FINE, "HistoryEntry : files {0} {1}",
LOGGER.log(Level.FINEST, "HistoryEntry : files {0} {1}",
new Object[]{separator, file});
separator = ">";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ public void updateRepositories() {
String type = repository.getClass().getSimpleName();

if (repository.isWorking()) {
LOGGER.info(String.format("Update %s repository in %s",
LOGGER.finest(String.format("Update %s repository in %s",
type, path));

try {
Expand Down Expand Up @@ -550,7 +550,7 @@ public void updateRepositories(Collection<String> paths) {
String type = repository.getClass().getSimpleName();

if (repository.isWorking()) {
LOGGER.info(String.format("Update %s repository in %s", type,
LOGGER.finest(String.format("Update %s repository in %s", type,
repository.getDirectoryName()));

try {
Expand All @@ -576,7 +576,7 @@ private void createCache(Repository repository, String sinceRevision) {
String type = repository.getClass().getSimpleName();

if (!repository.isHistoryEnabled()) {
LOGGER.log(Level.INFO,
LOGGER.log(Level.FINEST,
"Skipping history cache creation of {0} repository in {1} and its subdirectories",
new Object[]{type, path});
return;
Expand All @@ -585,7 +585,7 @@ private void createCache(Repository repository, String sinceRevision) {
if (repository.isWorking()) {
Statistics elapsed = new Statistics();

LOGGER.log(Level.INFO, "Creating historycache for {0} ({1}) {2} renamed file handling",
LOGGER.log(Level.FINEST, "Creating historycache for {0} ({1}) {2} renamed file handling",
new Object[]{path, type, repository.isHandleRenamedFiles() ? "with" : "without"});

try {
Expand Down Expand Up @@ -631,7 +631,7 @@ private void createCacheReal(Collection<Repository> repositories) {
}
}

LOGGER.log(Level.INFO, "Creating historycache for {0} repositories",
LOGGER.log(Level.FINEST, "Creating historycache for {0} repositories",
repos2process.size());
final CountDownLatch latch = new CountDownLatch(repos2process.size());
for (final Map.Entry<Repository, String> entry : repos2process.entrySet()) {
Expand Down Expand Up @@ -711,7 +711,7 @@ public List<String> clearCache(Collection<String> repositories) throws HistoryEx
try {
cache.clear(r);
clearedRepos.add(r.getDirectoryName());
LOGGER.log(Level.INFO,
LOGGER.log(Level.FINEST,
"History cache for {0} cleared.", r.getDirectoryName());
} catch (HistoryException e) {
LOGGER.log(Level.WARNING,
Expand Down Expand Up @@ -924,7 +924,7 @@ public void invalidateRepositories(Collection<? extends RepositoryInfo> repos, b
Collections.synchronizedMap(new HashMap<>(repos.size()));
Statistics elapsed = new Statistics();

LOGGER.log(Level.FINE, "invalidating {0} repositories", repos.size());
LOGGER.log(Level.FINEST, "invalidating {0} repositories", repos.size());

/*
* getRepository() below does various checks of the repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private void dumpEntry(HistoryEntry entry) {
}

private void parseDebug(String message) {
LOGGER.log(Level.FINE, "RazorHistoryParser: " + message );
LOGGER.log(Level.FINEST, "RazorHistoryParser: " + message );
}

private void parseProblem(String message) {
Expand Down
Loading