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

Consistent logging through the project #786

Closed
1 task
TerryHowe opened this issue Feb 3, 2023 · 7 comments
Closed
1 task

Consistent logging through the project #786

TerryHowe opened this issue Feb 3, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request logging question Further information is requested
Milestone

Comments

@TerryHowe
Copy link
Member

What is the version of your ORAS CLI

0.16.0

What would you like to be added?

Currently the project includes logrus which is fine, but logging is inconsistent and does not show the best separation of concerns. Ideally, this code should be capable of being used as an CLI executable and a go module.

  • It should have some interface users can implement if they want to use their own logging.
  • It should be initialized with a log level, which I suppose would be dictated by --debug and --verbose, but it should not know about those command line options
  • It should not expose its implementation
  • It should not know about objects related to this project

Reference current situation:

Why is this needed for ORAS?

Make the code more usable by other projects.

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.
@TerryHowe TerryHowe added the enhancement New feature or request label Feb 3, 2023
@shizhMSFT
Copy link
Contributor

shizhMSFT commented Feb 6, 2023

The oras CLI is not meant to be used as a go module. Users should only consume oras as an CLI executable.

Developers who are looking for an oras go module should take a look at oras-go.

@qweeah
Copy link
Contributor

qweeah commented Feb 11, 2023

FYI: For consistent logging as an CLI executable, there is an existing issue: #638

@qweeah
Copy link
Contributor

qweeah commented Mar 12, 2023

Reference current situation:

The mentioned situations cover totally different user scenarios. The former is targeted on stderr output for correlated http tracing, the latter focuses on timely status logging to stdout and might be extended to one-time structured output or maybe CLI progress bars if stdout is a terminal.

@shizhMSFT shizhMSFT added the question Further information is requested label Mar 22, 2023
@TerryHowe
Copy link
Member Author

Well, there is logging and there is output. I think the logging should all be routed to stderr like errors, debug output and verbose output. And then there is display output like you'd get from oras repo tags that should have another object to manage.

@qweeah
Copy link
Contributor

qweeah commented Apr 11, 2023

@TerryHowe Are you suggesting that you found some current output that should be replaced with logs?

there is display output like you'd get from oras repo tags that should have another object to manage.

Are you suggesting the preview warning should not be managed by logger but something else?

cc @FeynmanZhou

@shizhMSFT shizhMSFT added the stale Inactive issues or pull requests label Jun 28, 2023
@sajayantony
Copy link
Contributor

sajayantony commented Jul 19, 2023

From the call maybe we need to break this out into specific issues @TerryHowe

@FeynmanZhou FeynmanZhou added this to the future milestone Jul 19, 2023
@FeynmanZhou FeynmanZhou removed the stale Inactive issues or pull requests label Jul 19, 2023
@FeynmanZhou FeynmanZhou modified the milestones: future, v1.3.0 Mar 4, 2024
@TerryHowe
Copy link
Member Author

Done.

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

No branches or pull requests

5 participants