From ccb4c316dcafde1bda8cd3aedbd2b95cbff20b47 Mon Sep 17 00:00:00 2001 From: Robin Joseph Date: Sat, 21 May 2016 08:26:37 -0700 Subject: [PATCH] allow objects for hapi's request.log (#9353) --- hapi/hapi-tests.ts | 1 + hapi/hapi.d.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts index d45c03549a..743a4ad3ee 100644 --- a/hapi/hapi-tests.ts +++ b/hapi/hapi-tests.ts @@ -79,6 +79,7 @@ server.route({ method: 'GET', path: '/hello', handler: function (request: Hapi.Request, reply: Function) { + request.log('info', { route: '/hello' }, Date.now()); reply('hello world'); } }); diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 9962dd6c62..05f4aa1047 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -1301,7 +1301,7 @@ declare module "hapi" { log(/** a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.*/ tags: string | string[], /** an optional message string or object with the application data being logged.*/ - data?: string, + data?: any, /** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/ timestamp?: number): void;