Skip to content

Consistent logging through the project #786

Closed

Description

@TerryHowe

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.

Activity

  1. added
    enhancement
    on Feb 3, 2023
  2. shizhMSFT commented on Feb 6, 2023

    @shizhMSFT
    Contributor

    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.

  3. qweeah commented on Feb 11, 2023

    @qweeah
    Contributor

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

  4. qweeah commented on Mar 12, 2023

    @qweeah
    Contributor

    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.

  5. added
    question
    on Mar 22, 2023
  6. TerryHowe commented on Apr 10, 2023

    @TerryHowe
    MemberAuthor

    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.

  7. qweeah commented on Apr 11, 2023

    @qweeah
    Contributor

    @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

  8. added
    stale
    on Jun 28, 2023
  9. sajayantony commented on Jul 19, 2023

    @sajayantony
    Contributor

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

  10. added this to the future milestone on Jul 19, 2023
  11. removed
    stale
    on Jul 19, 2023
  12. modified the milestones: future, v1.3.0 on Mar 4, 2024
  13. TerryHowe commented on Jul 18, 2024

    @TerryHowe
    MemberAuthor

    Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementloggingquestion

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions