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

Make consistent warning/error output across different commands #455

Open
1 task
aaperis opened this issue Sep 27, 2024 · 0 comments
Open
1 task

Make consistent warning/error output across different commands #455

aaperis opened this issue Sep 27, 2024 · 0 comments

Comments

@aaperis
Copy link
Contributor

aaperis commented Sep 27, 2024

Please describe the feature
As a user/admin, I want to have a consistent format for the messages that the cli returns so that I know how to evaluate them/know what to expect when I embed the tool in scripts etc.

Example discrepancy:

./sda-cli decrypt -key alex.sec.pem b/* 
✔ Enter password to unlock private key: 
Decrypting file 1/6: b/file-list-1.c4gh
Warning: file b/file-list-2 is already decrypted, skipping
Warning: file b/file-list-2 is already decrypted, skipping
Decrypting file 4/6: b/file-list-3.c4gh
Warning: file b/file-list-4 is already decrypted, skipping
Warning: file b/file-list-4 is already decrypted, skipping

VS

./sda-cli encrypt -key alex.pub.pem a/* -continue
ERRO[0000] Skipping input file a/file-list-4.c4gh. Reason: input file a/file-list-4.c4gh is already encrypted(.c4gh). 
ERRO[0000] Skipping input file a/file-list-4. Reason: outfile a/file-list-4.c4gh already exists. 
ERRO[0000] Skipping input file a/file-list-2.c4gh. Reason: input file a/file-list-2.c4gh is already encrypted(.c4gh). 
ERRO[0000] Skipping input file a/file-list-2. Reason: outfile a/file-list-2.c4gh already exists. 
ERRO[0000] (4/6) files skipped

Acceptance criteria

  • Have a uniform way of returning messages to stdout/stderr (when and if to use fmt.Error, fmt.Print and log.Error).

Additional note
Remember to solve this comment: #451 (comment)
Decide a way in which order the warning/error message should be output

Estimation of size: medium

Estimation of priority: low

@nanjiangshu nanjiangshu changed the title Make logging uniform across different commands Make consistent warning/error output across different commands Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant