Skip to content

Commit

Permalink
Added some logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
csrster committed Aug 10, 2021
1 parent 63321f1 commit 17f6c88
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -28,6 +28,8 @@
import java.util.regex.Pattern;

import org.apache.lucene.util.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* This class is used for global constants only.
Expand All @@ -42,6 +44,10 @@
* This class is never instantiated, so thread security is not an issue.
*/
public final class Constants {

private static final Logger log = LoggerFactory.getLogger(Constants.class);


/** The pattern for an IP-address key. */
public static final String IP_REGEX_STRING = "[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}";
/** A full string matcher for an IP-address. */
Expand Down Expand Up @@ -175,6 +181,7 @@ public static String getHeritrix3VersionString() {
if (is != null) {
p.load(is);
h3version = p.getProperty("version", "");
log.debug("H3 version read from pom: {}", h3version);
}
} catch (Exception e) {
// ignore
Expand All @@ -183,14 +190,17 @@ public static String getHeritrix3VersionString() {
Package aPackage = org.archive.util.UriUtils.class.getPackage();
if (aPackage != null) {
h3version = aPackage.getImplementationVersion();
log.debug("H3 version read from implementation: {}", h3version);
if (h3version == null) {
h3version = aPackage.getSpecificationVersion();
log.debug("H3 version read from specification: {}", h3version);
}
}
}
if (h3version == null) {
h3version = "unknownHeritrixVersion";
}
log.debug("Final H3 version: {}", h3version);
return h3version;
}
}

0 comments on commit 17f6c88

Please sign in to comment.