Skip to content

Commit

Permalink
Merge pull request #6130 from chrisrueger/6123-improve-connectionsett…
Browse files Browse the repository at this point in the history
…ings-logging

improve logging for connections settings files
  • Loading branch information
chrisrueger committed May 27, 2024
2 parents 4dca2d9 + 6a8fcf9 commit abec712
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class ConnectionSettings {
.getUserHomeBnd("connection-settings.xml")
.getAbsolutePath();
private static final String CONNECTION_SETTINGS = "-connection-settings";
private final static String HELP_URL = "https://bnd.bndtools.org/instructions/connection-settings.html";
private final Processor processor;
private final HttpClient client;
private final List<ServerDTO> servers = new ArrayList<>();
Expand Down Expand Up @@ -136,6 +137,11 @@ public void readSettings() throws Exception {
return;
}

logger.info("[ConnectionSettings] Read from property: {} (See {} for more information)", CONNECTION_SETTINGS,
HELP_URL);
processor.trace("[ConnectionSettings] Read from property: %s (See %s for more information)",
CONNECTION_SETTINGS, HELP_URL);

List<File> tmps = new ArrayList<>();
try {
for (Map.Entry<String, Attrs> entry : connectionSettings.entrySet()) {
Expand Down Expand Up @@ -467,7 +473,16 @@ private void parse(File file) throws Exception {
try {
assert file != null : "File must be set";
assert file.isFile() : "File must be a file and exist";
parsed.add(file.getAbsolutePath());
String absolutePath = file.getAbsolutePath();
parsed.add(absolutePath);

logger.info(
"[ConnectionSettings] Read from file: {} (See {} for more information)", absolutePath,
HELP_URL);
processor.trace(
"[ConnectionSettings] Read from file: %s (See %s for more information)", absolutePath,
HELP_URL);

SettingsParser parser = new SettingsParser(file);

SettingsDTO settings = parser.getSettings();
Expand Down

0 comments on commit abec712

Please sign in to comment.