From 856a912ef70219a65f2f094a4983e51dcc9d771f Mon Sep 17 00:00:00 2001 From: Linnnus Date: Thu, 6 Feb 2025 18:22:32 +0100 Subject: ahmed/minecraft-log-server: Show more previous messages --- hosts/ahmed/minecraft-log-server/minecraft_log_server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hosts/ahmed/minecraft-log-server') diff --git a/hosts/ahmed/minecraft-log-server/minecraft_log_server.py b/hosts/ahmed/minecraft-log-server/minecraft_log_server.py index 30d295d..a676626 100644 --- a/hosts/ahmed/minecraft-log-server/minecraft_log_server.py +++ b/hosts/ahmed/minecraft-log-server/minecraft_log_server.py @@ -85,7 +85,6 @@ def get_log_entries(units, last_event_id = None) -> t.Generator[Event, None, Non "/run/current-system/sw/bin/journalctl", # We want a stream "--follow", - "--lines=20", # A JSON line for each entry "--output=json", # Use UTC timestamps to avoid tricky timezone issues on the client @@ -100,6 +99,10 @@ def get_log_entries(units, last_event_id = None) -> t.Generator[Event, None, Non # If this is such a connection, we can avoid including duplicate entries by # starting just after the given cursor. args.append("--after-cursor=" + last_event_id) + else: + # Otherwise this the user has just opened the page and we should give + # them a bit of context for the next lines that appear + args.append("--lines=200") try: process = subprocess.Popen(args, stdout=subprocess.PIPE) -- cgit v1.2.3