CLI: dora logs
enhancement
#1081
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds two options:
-f
/--follow
and-n
/--tail
todora logs
. These options behave similarly to their counterparts from docker container logs.Explanation
The
-f
/--follow
option allows users to stream logs in real-time from the daemon. This provides a continuous, live view, similar to how one might "attach" to the daemon's output.The -n/--tail option allows users to specify the number of historical log lines to display from the end of the log output. This could limit excessive output from the command.
Other modifications
Prior to this PR, logs were printed using
bat
. Whilebat
offers a wide range of features such as syntax highlighting and Git integration, only its paging functionality was ever utilized. Furthermore, the paging feature itself seems inconsistent and I can't make it work on my machine. Given these limitations, this PR removes thebat
dependency and now simply prints all logs directly to the console, allowing users to leverage their preferred pager for viewing, mirroring Docker's approach.