"""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
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)