From 09db2240a6615f3bc71fc1d64b5785921c59d214 Mon Sep 17 00:00:00 2001 From: Rohit Agarwal Date: Mon, 21 Apr 2025 17:11:55 +0530 Subject: [PATCH] Allow hook based logs --- src/middlewares/hooks/index.ts | 1 + src/middlewares/hooks/types.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/middlewares/hooks/index.ts b/src/middlewares/hooks/index.ts index a545ed1f6..eea7c71f1 100644 --- a/src/middlewares/hooks/index.ts +++ b/src/middlewares/hooks/index.ts @@ -299,6 +299,7 @@ export class HooksManager { execution_time: new Date().getTime() - createdAt.getTime(), transformed: result.transformed || false, created_at: createdAt, + log: result.log || null, }; } catch (err: any) { console.error(`Error executing check "${check.id}":`, err); diff --git a/src/middlewares/hooks/types.ts b/src/middlewares/hooks/types.ts index 4bfeaea53..0023c9db8 100644 --- a/src/middlewares/hooks/types.ts +++ b/src/middlewares/hooks/types.ts @@ -78,6 +78,7 @@ export interface GuardrailCheckResult { json: any; }; }; + log?: any; } export interface GuardrailResult {