mirror of
https://github.com/logos-messaging/logos-messaging-interop-tests.git
synced 2026-01-02 22:13:11 +00:00
* small improvements * minor adjustments * new tests * try with more runners * try with more runners2 * tweaks for parallel run * new tests * small tweaks * new tests * new tests * test remove defaults from CI * handle empty strings for env vars in CI * add nodekey to main node * add more tests * finishing touches * fixes based on Alex suggestions * revert unwanted change * add new pause test
25 lines
757 B
Python
25 lines
757 B
Python
import logging
|
|
|
|
max_log_line_length = 5000
|
|
|
|
|
|
def log_length_filter(max_length):
|
|
class logLengthFilter(logging.Filter):
|
|
def filter(self, record):
|
|
if len(record.getMessage()) > max_length:
|
|
logging.getLogger(record.name).log(
|
|
record.levelno, f"Log line was discarded because it's longer than max_log_line_length={max_log_line_length}"
|
|
)
|
|
return False
|
|
return True
|
|
|
|
return logLengthFilter()
|
|
|
|
|
|
def get_custom_logger(name):
|
|
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
|
logging.getLogger("docker").setLevel(logging.WARNING)
|
|
logger = logging.getLogger(name)
|
|
logger.addFilter(log_length_filter(max_log_line_length))
|
|
return logger
|