From 2acde897be905170a0825b5a29dd25fdcd1c4139 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Buchillon Date: Tue, 15 Dec 2020 19:34:06 -0800 Subject: stats_manager: formatting fix for md file output Minor formatting fix to make sure that .md files are \n terminated. Also a small change in the way we name the logger so that it derives the name directly from the class. BUG=b:174800621 BRANCH=None TEST=sudo servod -c kohaku_rev2_loc0.xml dut-power -t 3 // normal output Change-Id: I3e49068a7b0f3e8908fbcce6a13e083ce8e9216a Signed-off-by: Ruben Rodriguez Buchillon Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594689 Reviewed-by: Mengqi Guo --- extra/usb_power/stats_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'extra') diff --git a/extra/usb_power/stats_manager.py b/extra/usb_power/stats_manager.py index 4a13d13e07..9a4f4751fb 100644 --- a/extra/usb_power/stats_manager.py +++ b/extra/usb_power/stats_manager.py @@ -95,7 +95,7 @@ class StatsManager(object): self._accept_nan = accept_nan self._nan_domains = set() self._summary = {} - self._logger = logging.getLogger('StatsManager') + self._logger = logging.getLogger(type(self).__name__) def AddSample(self, domain, sample): """Add one sample for a domain. @@ -217,7 +217,8 @@ class StatsManager(object): if self._title: title_section = '**%s** \n\n' % self._title body = title_section + body - return body + # Make sure that the body is terminated with a newline. + return body + '\n' def SummaryToString(self, prefix=STATS_PREFIX): """Format summary into a string, ready for pretty print. -- cgit v1.2.1