Skip to content

Commit fefe611

Browse files
committed
Show timezone in logs and stats
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 6130597 commit fefe611

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

vulnerabilities/pipelines/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def execute(self):
121121
def log(self, message, level=logging.INFO):
122122
"""Log the given `message` to the current module logger and execution_log."""
123123
now_local = datetime.now(timezone.utc).astimezone()
124-
timestamp = now_local.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
124+
timestamp = now_local.strftime("%Y-%m-%d %T.%f %Z")
125125
message = f"{timestamp} {message}"
126126
module_logger.log(level, message)
127127
self.append_to_log(message)

vulnerabilities/templates/pipeline_run_details.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,27 @@ <h1 class="title">{{ pipeline_name }} Run Log</h1>
7777
</div>
7878
<div class="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile">
7979
<p class="is-size-7 has-text-weight-semibold">Start</p>
80-
<p class="has-text-grey is-size-7">{{ run.run_start_date|default:"N/A" }}</p>
80+
<p class="has-text-grey is-size-7">
81+
{% if run.run_start_date %}
82+
{{ run.run_start_date|date:"Y-m-d h:i a T" }}
83+
{% else %}
84+
N/A
85+
{% endif %}
86+
</p>
8187
</div>
8288
<div class="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile ">
8389
<p class="is-size-7 has-text-weight-semibold">End</p>
84-
<p class="has-text-grey is-size-7">{{ run.run_end_date|default_if_none:"N/A" }}</p>
90+
<p class="has-text-grey is-size-7">
91+
{% if run.run_end_date %}
92+
{{ run.run_end_date|date:"Y-m-d h:i a T" }}
93+
{% else %}
94+
N/A
95+
{% endif %}
96+
</p>
8597
</div>
8698
<div class="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile">
8799
<p class="is-size-7 has-text-weight-semibold">Created</p>
88-
<p class="has-text-grey is-size-7">{{ run.created_date }}</p>
100+
<p class="has-text-grey is-size-7">{{ run.created_date|date:"Y-m-d h:i a T" }}</p>
89101
</div>
90102
<div class="column is-one-fifth-desktop is-one-quarter-tablet is-half-mobile">
91103
<p class="is-size-7 has-text-weight-semibold">Version</p>

vulnerabilities/templates/pipeline_run_list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ <h1>{{ pipeline_name }} Runs</h1>
7777
</div>
7878
<div class="column is-one-fifth has-text-grey">
7979
{% if run.run_start_date %}
80-
{{ run.run_start_date|date:"Y-m-d H:i" }}
80+
{{ run.run_start_date|date:"Y-m-d h:i a T" }}
8181
{% else %}
8282
N/A
8383
{% endif %}
8484
</div>
8585
<div class="column is-one-fifth has-text-grey">
8686
{% if run.run_end_date %}
87-
{{ run.run_end_date|date:"Y-m-d H:i" }}
87+
{{ run.run_end_date|date:"Y-m-d h:i a T" }}
8888
{% else %}
8989
N/A
9090
{% endif %}

vulnerabilities/templates/pipeline_schedule_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ <h1>Pipeline Schedule</h1>
8181
<div class="column is-one-fifth has-text-grey"
8282
title="{{ schedule.latest_run_date }}">
8383
{% if schedule.latest_run_date %}
84-
{{ schedule.latest_run_date|date:"Y-m-d H:i" }}
84+
{{ schedule.latest_run_date|date:"Y-m-d h:i a T" }}
8585
{% else %}
8686
N/A
8787
{% endif %}

0 commit comments

Comments
 (0)