-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add button to error popup to zip log files #2296
Conversation
Adds a button to error popups that zips debug.log and bisq.log.
Got a
exception when trying it out on MAcOS. I guess the space in Application Support cause the issue. |
GridPane.setRowIndex(zipLogButton, gridPane.getRowCount()); | ||
gridPane.getChildren().add(zipLogButton); | ||
zipLogButton.setOnAction(event -> { | ||
URI uri = URI.create("jar:file:" + baseDir + "/bisq2-logs.zip"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem cross-platform compatible. Try this instead:
URI uri = URI.create("jar:file:" + Paths.get(baseDir,"bisq2-logs.zip").toUri().getPath());
Files.copy(Path.of(baseDir).resolve("bisq.log"), zipfs.getPath("/bisq.log"), StandardCopyOption.REPLACE_EXISTING); | ||
//TODO - when multi-transport support arrives, check which transports are being used and collect all instances of debug.log | ||
Files.copy(Path.of(baseDir + "/tor/").resolve("debug.log"), zipfs.getPath("/debug.log"), StandardCopyOption.REPLACE_EXISTING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you ensure that the files exist before copying them?
@@ -236,6 +236,7 @@ popup.headline.invalid=Invalid input | |||
popup.headline.error=Error | |||
|
|||
popup.reportError.log=Open log file | |||
popup.zipLogs.log=Zip log files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to follow popup.reportError.zipLogs
as the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can you improve the text in the pop-up to indicate that a zip file can be generated and attached when reporting a bug?
- There should be some UI feedback when using this button. E.g. if the zip file is generated correctly, say where it can be found, its name, etc.
- Perhaps it would be useful to include all available log files, not only
bisq.log
but alsobisq_1.log
, etc.
@djing-chan Thanks for catching that! I forget that I'm used to writing for a niche platform sometimes; should have been more mindful of platform behavior. @axpoems Agree with your suggestions, working on them. I'm not exactly sure how much value would be in having all log files, but there's probably some scenarios in which it could be useful, so might as well. |
This could become very large... I think the default log should be enough in most cases |
I can't figure out how to escape single quotes.
@axpoems I think I've addressed all of your concerns in subsequent commits, aside from adding all logs to the zip. I don't know how much of a concern sizes would be in practice, because the log files compress pretty well (~10x for bisq.log, ~100x for debug.log), but given an instance running long enough it seems like it could potentially become undesirable. |
I still get the same exception as I posted above |
The machine I'm writing this on is a bit too underpowered to make spinning up a new Mac VM convenient. Will do so on a different machine in a day or two and figure out what the proper fix is. |
I think you can simulate it by adding a space in the data directory. I think the space in the path is not supported in API you use. |
@djing-chan Can you try now? It works on my test machine, but I'd like to make sure. |
@djing-chan Good feedback; can you test the most recent revision? I think it fulfills your criteria. |
Yes it opens now the directory. |
@djing-chan Sure, I can do that. |
@djing-chan Does that flow fit for you, or were you thinking something different? |
Superseded by #2334. |
Adds a button to error popups that zips debug.log and bisq.log.
Partially solves #2291