refactor(logging): standardize logging approach across services and steps
This commit is contained in:
@@ -32,23 +32,33 @@ async def handler(request: ApiRequest, ctx: FlowContext[Any]) -> ApiResponse:
|
||||
body={'error': 'Endpoint required as query parameter'}
|
||||
)
|
||||
|
||||
ctx.logger.info("=" * 80)
|
||||
ctx.logger.info("🔄 ADVOWARE PROXY: GET REQUEST")
|
||||
ctx.logger.info("=" * 80)
|
||||
ctx.logger.info(f"Endpoint: {endpoint}")
|
||||
ctx.logger.info("=" * 80)
|
||||
|
||||
# Initialize Advoware client
|
||||
advoware = AdvowareAPI(ctx)
|
||||
|
||||
# Forward all query params except 'endpoint'
|
||||
params = {k: v for k, v in request.query_params.items() if k != 'endpoint'}
|
||||
|
||||
ctx.logger.info(f"Proxying GET request to Advoware: {endpoint}")
|
||||
result = await advoware.api_call(
|
||||
endpoint,
|
||||
method='GET',
|
||||
params=params
|
||||
)
|
||||
|
||||
ctx.logger.info("✅ Proxy GET erfolgreich")
|
||||
return ApiResponse(status=200, body={'result': result})
|
||||
|
||||
except Exception as e:
|
||||
ctx.logger.error(f"Proxy error: {e}")
|
||||
ctx.logger.error("=" * 80)
|
||||
ctx.logger.error("❌ ADVOWARE PROXY GET FEHLER")
|
||||
ctx.logger.error(f"Endpoint: {request.query_params.get('endpoint', 'N/A')}")
|
||||
ctx.logger.error(f"Error: {e}")
|
||||
ctx.logger.error("=" * 80)
|
||||
return ApiResponse(
|
||||
status=500,
|
||||
body={'error': 'Internal server error', 'details': str(e)}
|
||||
|
||||
Reference in New Issue
Block a user