diff options
author | Ruben Rodriguez Buchillon <coconutruben@chromium.org> | 2020-12-15 19:34:06 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-21 06:32:20 +0000 |
commit | 2acde897be905170a0825b5a29dd25fdcd1c4139 (patch) | |
tree | 839dec49462d34bbb6d29322eeae828623ef2639 | |
parent | 05dbb0a1d8647f9468f7d6400e4013aa5258063a (diff) | |
download | chrome-ec-2acde897be905170a0825b5a29dd25fdcd1c4139.tar.gz |
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 <coconutruben@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594689
Reviewed-by: Mengqi Guo <mqg@chromium.org>
-rw-r--r-- | extra/usb_power/stats_manager.py | 5 |
1 files changed, 3 insertions, 2 deletions
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. |