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

CLI flag to log stdout messages as JSON #18

Open
Jazcash opened this issue Sep 4, 2022 · 2 comments
Open

CLI flag to log stdout messages as JSON #18

Jazcash opened this issue Sep 4, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Jazcash
Copy link
Member

Jazcash commented Sep 4, 2022

This will make it easier for the lobby to parse info from prd. Ideally, each object would follow a standard format, such as:

[Info] /spring/tools/pr-downloader/src/pr-downloader.cpp:178:DownloadSetConfig():Free disk space: 172128 MB

->

{
    "type": "info",
    "message": "Free disk space: 172128 MB"
}

 

[Progress]   7% [==                            ] 6550225/90399836

->

{
    "type": "download",
    "content": "Beyond All Reason test-16314-fff9e7a",
    "progress": {
        "bytesDownloaded": 6550225,
        "totalBytes": 90399836,
        "percent": 0.07
    }
}

There's also lot of guff in the current stdout that isn't useful for end users, would be preferable to hide that behind a --verbose flag.

@p2004a
Copy link
Collaborator

p2004a commented Sep 4, 2022

So, that's 2 feature requests:

  • ask to select logging level dynamically (low prio, you can filter out in lobby imho)
  • add option to log as JSON.

For logging as JSON, I have one problem that I've not figure out yet: internationalization of messages. Do we need to do that? Maybe the messages somehow should be more structured so that lobby can translate? Or we assume that all errors, including retry messages it's fine to present in English?

@p2004a p2004a added the enhancement New feature or request label Sep 4, 2022
@Jazcash
Copy link
Member Author

Jazcash commented Sep 4, 2022

Fine for messages to be in english as it's only a CLI tool and nothing we expect players to use themselves. As for BAR Lobby, anything prd does will be parsed and presented to the end user in a nice way and raw messages won't ever be shown as-is.

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

No branches or pull requests

2 participants