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

Save logs for swap started with --json flag and save all logs in JSON format #849

Closed
binarybaron opened this issue Nov 28, 2021 · 2 comments · Fixed by #869
Closed

Save logs for swap started with --json flag and save all logs in JSON format #849

binarybaron opened this issue Nov 28, 2021 · 2 comments · Fixed by #869

Comments

@binarybaron
Copy link
Collaborator

binarybaron commented Nov 28, 2021

Describe the bug
The logs are not saved when the swap is started with the --json flag. This makes it much more difficult to reconstruct the previous swap state when resuming a swap, which is necessary for the GUI I am working on. In addition, it would be very helpful if all saved logs were saved in JSON format, as this would allow for the GUI to resume and display proper information about swaps that were not initiated using the GUI.

Lost/trapped Funds
No

Platform (please complete the following information):

  • CLI
  • Software Version All
  • Operating System: All
@binarybaron binarybaron changed the title Save logs for swap started with --json flag Save logs for swap started with --json flag and save all logs in JSON format Nov 28, 2021
@rishflab
Copy link
Member

rishflab commented Dec 7, 2021

Hi sorry for the delayed resposen.

Could you pipe the json output to a file?

What about directly accessing the recently introduced sqlite database?

@binarybaron
Copy link
Collaborator Author

Hi sorry for the delayed resposen.

No worries, I know you guys are also working on other projects.

Could you pipe the json output to a file?

This is basically what we are doing at the moment, but it seems like something that should be handled by the cli itself. It would also help to be fully compatible with swaps initiated with the cli and not with our GUI, since we can't store logs manually for those and it would give us some important information about those swaps that can't be extracted from the database (or at least not easily)

https://github.com/UnstoppableSwap/unstoppableswap-gui/blob/d80b8082a1fb342e2b04cb26e5db22f634270a1e/src/main/cli/commands/buyXmrCommand.ts#L49-L60

What about directly accessing the recently introduced sqlite database?

The GUI does use the sqlite database to retrieve information about the states of swaps but primarily for displaying information about swaps that have occurred in the past (swap history page). For running swaps we rely on the logs because some data is not easily extractable from the database (e.g transaction ids)

@rishflab rishflab linked a pull request Dec 13, 2021 that will close this issue
@bors bors bot closed this as completed in #869 Dec 23, 2021
bors bot added a commit that referenced this issue Jan 31, 2022
893: Always write logs as JSON to file r=thomaseizinger a=binarybaron

Related issue: #849

Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
bors bot added a commit that referenced this issue Jan 31, 2022
893: Always write logs as JSON to file r=thomaseizinger a=binarybaron

Related issue: #849

Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
bors bot added a commit that referenced this issue Feb 22, 2022
893: Always write logs as JSON to file r=binarybaron a=binarybaron

Related issue: #849

Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
bors bot added a commit that referenced this issue Feb 23, 2022
893: Always write logs as JSON to file r=binarybaron a=binarybaron

Related issue: #849

Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

2 participants