MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / StreamToLogger

Class StreamToLogger

web/regression/runtests.py:448–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446
447
448class StreamToLogger():
449 def __init__(self, logger, log_level=logging.INFO):
450 self.terminal = sys.stderr
451 self.logger = logger
452 self.log_level = log_level
453 self.linebuf = ''
454
455 def write(self, buf):
456 """
457 This function writes the log in the logger file as well as on console
458
459 :param buf: log message
460 :type buf: str
461 :return: None
462 """
463
464 self.terminal.write(buf)
465 for line in buf.rstrip().splitlines():
466 self.logger.log(self.log_level, line.rstrip())
467
468 def flush(self):
469 # Function required to be implemented for logger
470 pass
471
472
473def execute_test(test_module_list_passed, server_passed, driver_passed,

Callers 1

runtests.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected