Added option to log without timestamps

This commit is contained in:
Victor Alexeev
2026-05-28 16:52:39 +02:00
committed by Mark Qvist
parent a5ca1ee41e
commit b4e15503c1
3 changed files with 12 additions and 2 deletions
+3
View File
@@ -458,6 +458,9 @@ class Reticulum:
RNS.loglevel = 0
if RNS.loglevel > 7:
RNS.loglevel = 7
elif option == "logtimestamps":
value = self.config["logging"].as_bool(option)
RNS.logtimestamps = bool(value)
if "reticulum" in self.config:
for option in self.config["reticulum"]:
+6
View File
@@ -262,6 +262,12 @@ instance_name = default
loglevel = 4
# You can disable timestamp inclusion in logs. Useful if
# you want to use an external logging tool that provides
# its own timestamps or custom formatting.
# logtimestamps = no
# The interfaces section defines the physical and virtual
# interfaces Reticulum will use to communicate on. This
+3 -2
View File
@@ -82,6 +82,7 @@ loglevel = LOG_NOTICE
logfile = None
logdest = LOG_STDOUT
logcall = None
logtimestamps = True
logtimefmt = "%Y-%m-%d %H:%M:%S"
logtimefmt_p = "%H:%M:%S.%f"
compact_log_fmt = False
@@ -127,8 +128,8 @@ def log(msg, level=3, _override_destination = False, pt=False):
if loglevel >= level:
if pt: logstring = "["+precise_timestamp_str(time.time())+"] "+loglevelname(level)+" "+msg
else:
if not compact_log_fmt: logstring = "["+timestamp_str(time.time())+"] "+loglevelname(level)+" "+msg
else: logstring = "["+timestamp_str(time.time())+"] "+msg
if not compact_log_fmt: logstring = ("["+timestamp_str(time.time())+"] " if logtimestamps else "")+loglevelname(level)+" "+msg
else: logstring = ("["+timestamp_str(time.time())+"] " if logtimestamps else "")+msg
with logging_lock:
if (logdest == LOG_STDOUT or _always_override_destination or _override_destination):