You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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.
Activity
shizhMSFT commentedon Feb 6, 2023
The
orasCLI is not meant to be used as a go module. Users should only consumeorasas an CLI executable.Developers who are looking for an
orasgo module should take a look at oras-go.qweeah commentedon Feb 11, 2023
FYI: For consistent logging as an CLI executable, there is an existing issue: #638
qweeah commentedon Mar 12, 2023
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.
TerryHowe commentedon Apr 10, 2023
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 tagsthat should have another object to manage.qweeah commentedon Apr 11, 2023
@TerryHowe Are you suggesting that you found some current output that should be replaced with logs?
Are you suggesting the preview warning should not be managed by
loggerbut something else?cc @FeynmanZhou
sajayantony commentedon Jul 19, 2023
From the call maybe we need to break this out into specific issues @TerryHowe
TerryHowe commentedon Jul 18, 2024
Done.