For ease of readability, switch log timestamps from traditional
"asctime" format to ISO 8601 date and time.
# provided in the LICENSE file distributed with this software.
import codecs
+import datetime
import os
import random
import re
file_name = ""
max_log_lines = 0
syslog_name = ""
- timestamp = time.asctime()[4:19]
+ timestamp = datetime.datetime.now().isoformat(' ')
# turn the message into a list of nonempty lines
lines = [x for x in [(x.rstrip()) for x in message.split("\n")] if x != ""]
# unescaped and deduplicated to a single \xff in the buffer and then
# the line of input discarded as a non-ASCII sequence
(2, "> ", b"say argle\xff\xffbargle\r\0"),
- (2, r"Non-ASCII characters from admin: b'say argle\\xffbargle'.*> ", ""),
+ (2, r"Non-ASCII characters from admin: b'say.*argle\\xffbargle'.*> ", ""),
)
test_telnet_unknown_command = (