Esempio n. 1
0
 def __init__(self, name):
     hdlr = logging.StreamHandler(sys.stdout)
     want_ansi = os.getenv("COCOTB_ANSI_OUTPUT")
     if want_ansi is None:
         want_ansi = sys.stdout.isatty()  # default to ANSI for TTYs
     else:
         want_ansi = want_ansi == '1'
     if want_ansi:
         hdlr.setFormatter(SimColourLogFormatter())
     else:
         hdlr.setFormatter(SimLogFormatter())
     self.name = name
     self.handlers = []
     self.disabled = False
     self.filters = []
     self.propagate = False
     logging.__init__(name)
     self.addHandler(hdlr)
     self.setLevel(logging.NOTSET)
Esempio n. 2
0
File: log.py Progetto: FinnG/cocotb
 def __init__(self, name):
     hdlr = logging.StreamHandler(sys.stdout)
     want_ansi = os.getenv("COCOTB_ANSI_OUTPUT")
     if want_ansi is None:
         want_ansi = sys.stdout.isatty() # default to ANSI for TTYs
     else:
         want_ansi = want_ansi == '1'
     if want_ansi:
         hdlr.setFormatter(SimColourLogFormatter())
     else:
         hdlr.setFormatter(SimLogFormatter())
     self.name = name
     self.handlers = []
     self.disabled = False
     self.filters = []
     self.propagate = False
     logging.__init__(name)
     self.addHandler(hdlr)
     self.setLevel(logging.INFO)