Skip to content

Commit 28d2f38

Browse files
committed
feat: modify log format, add response time
Signed-off-by: ImMin5 <[email protected]>
1 parent 0d834fd commit 28d2f38

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/spaceone/core/service/__init__.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import copy
12
import functools
23
import logging
3-
import copy
4+
import time
45
from typing import Generator, Union, Literal
56

67
from opentelemetry import trace
@@ -181,6 +182,8 @@ def _pipeline(
181182

182183
try:
183184
with _TRACER.start_as_current_span("PreProcessing"):
185+
start_time = time.time()
186+
184187
# 1. Event - Start
185188
if event_handler_state:
186189
for handler in get_event_handlers():
@@ -239,7 +242,9 @@ def _pipeline(
239242

240243
# 9. Print Response Info Log
241244
if print_info_log:
242-
_LOGGER.info(f"(RESPONSE) => SUCCESS")
245+
246+
process_time = time.time() - start_time
247+
_LOGGER.info(f"(RESPONSE) => SUCCESS (Time = {process_time:.2f}s")
243248

244249
return response_or_iterator
245250

0 commit comments

Comments
 (0)