Skip to content

Modify log format, add response time #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/spaceone/core/service/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import copy
import functools
import logging
import copy
import time
from typing import Generator, Union, Literal

from opentelemetry import trace
Expand Down Expand Up @@ -181,6 +182,8 @@ def _pipeline(

try:
with _TRACER.start_as_current_span("PreProcessing"):
start_time = time.time()

# 1. Event - Start
if event_handler_state:
for handler in get_event_handlers():
Expand Down Expand Up @@ -239,7 +242,9 @@ def _pipeline(

# 9. Print Response Info Log
if print_info_log:
_LOGGER.info(f"(RESPONSE) => SUCCESS")

process_time = time.time() - start_time
_LOGGER.info(f"(RESPONSE) => SUCCESS (Time = {process_time:.2f}s)")

return response_or_iterator

Expand Down
Loading