Skip to content

[Feature request] Log retrieval without attaching #19

@greatvovan

Description

@greatvovan

Since the main purpose of this class of tools is launching long-running precesses, it would be great to be able to quickly peak into log output without retrieving the full log (think of searching through a GitHub Action log while it still runs).

Another category of cases is reviewing logs from past sessions.

Use cases

1. Check if the launched process completed

Usually done by looking at the latest output which is expected to finish with a specific completion message, stopping incremental output, or an error message in case of problems.

2. Test for specific log output in the history

Ensure the process goes as expected or has passed a specific stage.

3. Check what I did last time

I upgraded the server a month ago, I want to review the flow of that process.
[Works in conjunction with #21 ]

Suggestion

Offload the search to the client (grep), but tweak the log retrieval that the program already does.

Commands:
  log     [-f] [-t N] <session>		Fetch session log without attaching
    -f								Follow log output
    -t <lines>						Number of recent lines (default 10)

Examples

atch log -t session1 — display recent output and exit (case 1)
atch log session2 | grep "numpy==2.4.3" — test for specific output and exit (case 2)
atch log -f session2 | grep -e 'WARNING|ERROR' — filter specific messages continuously (case 2)
atch log last_month | more — recall what I did last time (case 3)

In combination with a suggestion from another issue, a tail option would give a consistent experience:

atch attach -t 10 session3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions