From aa9c3e17f4d7e76ed5f5b7000b5a3a82f29a77f0 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sun, 24 Jul 2016 01:14:10 +0000 Subject: [PATCH] Rename internal:logging: to .mudpy.log Convert the old style internal:logging element to a new style .mudpy.log element and adjust the log() function accordingly. --- etc/mudpy.yaml | 9 ++++----- lib/mudpy/misc.py | 10 ++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/etc/mudpy.yaml b/etc/mudpy.yaml index 0d61479..74cfe6e 100644 --- a/etc/mudpy.yaml +++ b/etc/mudpy.yaml @@ -18,11 +18,10 @@ __control__: #.mudpy.limit.backups: 10 .mudpy.limit.password_tries: 3 -internal:logging: - #file: mudpy.log - max_log_lines: 1000 - stdout: yes - #syslog: mudpy +#.mudpy.log.file: mudpy.log +.mudpy.log.lines: 1000 +.mudpy.log.stdout: true +#.mudpy.log.syslog: mudpy internal:network: host: ::1 diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index 2dc75c0..c5e1d1b 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -1008,11 +1008,9 @@ def log(message, level=0): """Log a message.""" # a couple references we need - file_name = universe.categories["internal"]["logging"].get("file") - max_log_lines = universe.categories["internal"]["logging"].get( - "max_log_lines" - ) - syslog_name = universe.categories["internal"]["logging"].get("syslog") + file_name = universe.contents["mudpy.log"].get("file") + max_log_lines = universe.contents["mudpy.log"].get("lines") + syslog_name = universe.contents["mudpy.log"].get("syslog") timestamp = time.asctime()[4:19] # turn the message into a list of nonempty lines @@ -1029,7 +1027,7 @@ def log(message, level=0): file_descriptor.close() # send the timestamp and line to standard output - if universe.categories["internal"]["logging"].get("stdout"): + if universe.contents["mudpy.log"].get("stdout"): for line in lines: print(timestamp + " " + line) -- 2.11.0