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

[httpclient] Implement log as specified in doc #5242

Merged
merged 1 commit into from May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -85,7 +85,6 @@ private void assertOk(String username, String password, boolean verify) throws E
p.setProperty("-connection-log", log.toURI()
.getPath());
p.setProperty("-connection-settings", settings);
hc.setLog(log);

ConnectionSettings cs = new ConnectionSettings(p, hc);
cs.readSettings();
Expand Down
Expand Up @@ -35,6 +35,7 @@
import aQute.bnd.header.Attrs;
import aQute.bnd.header.Parameters;
import aQute.bnd.http.HttpClient;
import aQute.bnd.osgi.Constants;
import aQute.bnd.osgi.Processor;
import aQute.bnd.osgi.Processor.FileLine;
import aQute.bnd.service.url.ProxyHandler;
Expand Down Expand Up @@ -73,6 +74,13 @@ public class ConnectionSettings {
public ConnectionSettings(Processor processor, HttpClient client) throws Exception {
this.processor = Objects.requireNonNull(processor);
this.client = client;
String logfile = processor.getProperty(Constants.CONNECTION_LOG);
if (Strings.nonNullOrEmpty(logfile)) {
File file = IO.getFile(logfile);
file.getParentFile()
.mkdirs();
this.client.setLog(file);
}
mavenMasterPassphrase = new MasterPassphrase(processor);
}

Expand Down
2 changes: 2 additions & 0 deletions biz.aQute.bndlib/src/aQute/bnd/osgi/Constants.java
Expand Up @@ -116,6 +116,8 @@ public interface Constants {
String DEFINE_CONTRACT = "-define-contract";
String CONDITIONALPACKAGE = "-conditionalpackage";
String CONNECTION_SETTINGS = "-connection-settings";
String CONNECTION_LOG = "-connection-log";

String COMPRESSION = "-compression";
String DIFFIGNORE = "-diffignore";
String DIFFPACKAGES = "-diffpackages";
Expand Down
2 changes: 1 addition & 1 deletion docs/_instructions/connection-settings.md
Expand Up @@ -45,7 +45,7 @@ You can create a log file specific for the connections by specifying:

-connection-log: somefile.txt

This file will contain the detailed trace output
This file will contain the detailed trace output. The file given is relative to the working directory.

## Syntax

Expand Down