From d8697f43ccd32dda17ac364684e0ceccab9be82a Mon Sep 17 00:00:00 2001 From: Ties de Kock Date: Mon, 11 Dec 2023 20:48:07 +0100 Subject: [PATCH] Chronological order --- CHANGELOG.md | 1 + sagemcom_f3896_client/exporter.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d3e48..afb78e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,3 +9,4 @@ INFO:f3896.eventlog:2023-12-09T19:46:45+00:00 [notice]: US profile assignment change. US Chan ID: 27; Previous Profile: 10 13; New Profile: 11 13.;CM-MAC=44:05:de:ad:be:ef;CMTS-MAC=00:01:de:ad:be:ef;CM-QOS=1.1;CM-VER=3.1; INFO:f3896.eventlog:2023-12-09T18:36:26+00:00 [notice]: US profile assignment change. US Chan ID: 27; Previous Profile: 9 13; New Profile: 10 13.;CM-MAC=44:05:de:ad:be:ef;CMTS-MAC=00:01:de:ad:be:ef;CM-QOS=1.1;CM-VER=3.1; ``` + * Log these messages in chronological order (newest last) diff --git a/sagemcom_f3896_client/exporter.py b/sagemcom_f3896_client/exporter.py index 8f7e33d..20c0c3b 100644 --- a/sagemcom_f3896_client/exporter.py +++ b/sagemcom_f3896_client/exporter.py @@ -380,7 +380,7 @@ async def __log_based_metrics(self, registry: CollectorRegistry) -> None: # print the new log message current_messages = set(log_lines) new_messages = current_messages - self.previous_logs - for msg in sorted(new_messages, reverse=True): + for msg in sorted(new_messages): MODEM_LOG.info( "%s [%s]: %s", msg.time.isoformat(), msg.priority, msg.message )