From 7355f5a4d40a87d56713f1f476ded0e336f600c5 Mon Sep 17 00:00:00 2001 From: Chi Song Date: Thu, 5 Aug 2021 00:28:19 -0700 Subject: [PATCH] console notifier: hide description reduce the log --- lisa/notifiers/console.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisa/notifiers/console.py b/lisa/notifiers/console.py index fdfd2ba0a..a6c925021 100644 --- a/lisa/notifiers/console.py +++ b/lisa/notifiers/console.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. +import copy import logging from dataclasses import dataclass from typing import Any, List, Type, cast @@ -34,6 +35,12 @@ class Console(notifier.Notifier): return ConsoleSchema def _received_message(self, message: notifier.MessageBase) -> None: + if isinstance(message, TestResultMessage): + # The description of test result is too long to display. Hide it for + # log readability. + message = copy.deepcopy(message) + description = message.information.get("description", "") + message.information["description"] = f"<{len(description)} bytes>" self._log.log( getattr(logging, self._log_level), f"received message [{message.type}]: {message}",