From 6a1400b700674f638b13cc1a225eb1d803636eee Mon Sep 17 00:00:00 2001 From: Steve Pothier Date: Sun, 29 Sep 2024 07:27:12 -0700 Subject: [PATCH] clean time-log --- .../ts/logging_and_reporting/source_adapters.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/python/lsst/ts/logging_and_reporting/source_adapters.py b/python/lsst/ts/logging_and_reporting/source_adapters.py index bf04025..2da7dc9 100644 --- a/python/lsst/ts/logging_and_reporting/source_adapters.py +++ b/python/lsst/ts/logging_and_reporting/source_adapters.py @@ -129,8 +129,10 @@ def row_header(self): return '| Time | Message |\n|--------|------|' def row_str_func(self, datetime_str, rec): - msg = rec['message_text'] - return f'> {datetime_str} |
{msg}
' + msg = rec['message_text'].strip() + #!return f'> {datetime_str} |
{msg}
' + #!return f'```\n{msg}\n```' + return f'`{datetime_str}`\n```\n{msg}\n```' # Break on DAY_OBS. Within that, break on DATE, within that only show time. @@ -261,13 +263,13 @@ def __init__(self, *, limit=None, ): super().__init__() - self.limit = SourceAdapter.limit if limit is None else limit self.server = SourceAdapter.server if server_url is None else server_url if min_date: self.min_date = min_date self.max_date = max_date self.min_day_obs = ut.datetime_to_day_obs(min_date) self.max_day_obs = ut.datetime_to_day_obs(max_date) + self.limit = SourceAdapter.limit if limit is None else limit # status[endpoint] = dict(endpoint_url, number_of_records, error) self.status = dict() @@ -278,7 +280,10 @@ def __init__(self, *, def row_str_func(self, datetime_str, rec): - return f"> {datetime_str} |
{rec['summary']}
" + #!return f"> {datetime_str} |
{rec['summary']}
" + msg = rec['summary'].strip() + return f'`{datetime_str}`\n```\n{msg}\n```' + def get_records(self, site_ids=None, @@ -504,10 +509,12 @@ def row_header(self): ) def row_str_func(self, datetime_str, rec): + msg = rec['message_text'].strip() return(f"> {datetime_str} " f"| {rec['obs_id']} " f"| {rec['instrument']} " - f"|
{rec['message_text']}
" + #! f"|
{msg}
" + f'\n```\n{msg}\n```' )