allow objects for hapi's request.log (#9353)

This commit is contained in:
Robin Joseph 2016-05-21 08:26:37 -07:00 committed by Masahiro Wakame
parent ac94ea7331
commit ccb4c316dc
2 changed files with 2 additions and 1 deletions

View File

@ -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');
}
});

2
hapi/hapi.d.ts vendored
View File

@ -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;