Commit 08af87d1 authored by Michael Büsch's avatar Michael Büsch

logging: Add prefix support

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent f9e779b3
......@@ -41,6 +41,7 @@ class Logging(object):
EnumGen.end
loglevel = LOG_INFO
prefix = ""
@classmethod
def setLoglevel(cls, loglevel):
......@@ -53,8 +54,14 @@ class Logging(object):
raise AwlSimError("Invalid log level '%d'" % loglevel)
cls.loglevel = loglevel
@classmethod
def setPrefix(cls, prefix):
cls.prefix = prefix
@classmethod
def __print(cls, stream, text):
if cls.prefix:
stream.write(cls.prefix)
stream.write(text)
stream.write("\n")
stream.flush()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment