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

Server Logs Read Fix #417

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Server Logs Read Fix #417

wants to merge 5 commits into from

Conversation

valaises
Copy link
Member

@valaises valaises commented May 3, 2024

No description provided.

@valaises valaises requested a review from mitya52 May 3, 2024 16:04
@valaises valaises self-assigned this May 3, 2024
@olegklimov
Copy link
Contributor

live streaming -n 1000 is a good idea

for plain file 50000 maybe is a good idea too

refact_webgui/webgui/tab_server_logs.py Outdated Show resolved Hide resolved
refact_webgui/webgui/tab_server_logs.py Outdated Show resolved Hide resolved
refact_webgui/webgui/tab_server_logs.py Outdated Show resolved Hide resolved
refact_webgui/webgui/tab_server_logs.py Outdated Show resolved Hide resolved
refact_webgui/webgui/tab_server_logs.py Outdated Show resolved Hide resolved
refact_webgui/webgui/tab_server_logs.py Outdated Show resolved Hide resolved
Comment on lines 47 to 51
for line in tailer.tail(open(right_file, 'r'), last_n_lines):
yield line + '\n'

if stream:
async for line in atail(right_file): # (line, from_file)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we can loose some lines from working logs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inthe case of streaming it should work exactly as
tail -n last_n_lines -f logfile

@mitya52
Copy link
Member

mitya52 commented May 16, 2024

doesn't work correctly with

  • non-existed file or non-file paths: stuck without exit
  • stream=False doesn't work for regular log files, while loops forever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants