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

Clarify error logging around exe download in extractProtoc #81

Open
clairemcginty opened this issue Jun 29, 2020 · 3 comments
Open

Clarify error logging around exe download in extractProtoc #81

clairemcginty opened this issue Jun 29, 2020 · 3 comments

Comments

@clairemcginty
Copy link

from extractProtoc:

File exeFile = null;
if (protocVersion.mArtifact == null) { // look for embedded protoc and on web (maven central)
// look for embedded version
String srcFilePath = "bin/" + protocVersion.mVersion + "/" + getProtocExeName(protocVersion);
try {
File protocTemp = new File(binDir, "protoc.exe");
populateFile(srcFilePath, protocTemp);
log("embedded: " + srcFilePath);
protocTemp.setExecutable(true);
protocTemp.deleteOnExit();
return protocTemp;
}
catch (FileNotFoundException e) {
//log(e);
}
// look in cache and maven central
exeFile = findDownloadProtoc(protocVersion);
}
else { // download by artifact id from maven central
String downloadPath = protocVersion.mGroup.replace(".", "/") + "/" + protocVersion.mArtifact + "/";
exeFile = downloadProtoc(protocVersion, downloadPath, true);
}
if (exeFile == null) throw new FileNotFoundException("Unsupported platform: " + getProtocExeName(protocVersion));

I've occasionally seen transient issues with Maven downloads/caching that result in exeFile being evaluated to null -- but the error message is always "Unsupported platform", which isn't always accurate. I think having a bit more specific logging on which step actually failed would be really helpful.

@os72
Copy link
Owner

os72 commented Aug 15, 2020

Ack, thanks
(Please note I need to limit the time I dedicate to this project. Would you / your employer consider sponsoring/donating?)

@clairemcginty
Copy link
Author

clairemcginty commented Oct 26, 2021

@os72, coming back to this issue, would you be open to introducing a logging lib (slf4j or JUL) into this repo? that way we could replace some of the commented-out log(...) calls in the code with a Logger#debug, and the user could specify how noisy they'd like log output to be.

I understand wanting to keep the repo vanilla Java though

@os72
Copy link
Owner

os72 commented Dec 5, 2021

Would your employer consider supporting this project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants