From 6666276c838e1931669194b77cce5a637df7315f Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Fri, 21 Jun 2019 15:44:45 -0700 Subject: [PATCH] feat: add support for apiEndpoint override (#352) --- src/types/core.d.ts | 2 ++ test/index.ts | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/types/core.d.ts b/src/types/core.d.ts index 046deee9..9ceef20a 100644 --- a/src/types/core.d.ts +++ b/src/types/core.d.ts @@ -103,6 +103,8 @@ export interface Options { prefix?: string; labels?: {[key: string]: string}; + + apiEndpoint?: string; } export interface MonitoredResource { diff --git a/test/index.ts b/test/index.ts index c84e12ae..93003746 100644 --- a/test/index.ts +++ b/test/index.ts @@ -72,6 +72,7 @@ describe('logging-winston', () => { serviceContext: { service: 'fake-service', }, + apiEndpoint: 'fake.local', }; beforeEach(() => { @@ -96,6 +97,12 @@ describe('logging-winston', () => { assert.deepStrictEqual(fakeLoggingOptions_, optionsWithScopes); }); + it('should initialize Log instance using provided apiEndpoint', () => { + const options = Object.assign({}, OPTIONS); + const logger = new loggingWinstonLib.LoggingWinston(options); + assert.deepStrictEqual(fakeLoggingOptions_, options); + }); + it('should pass the provided options.inspectMetadata', () => { const optionsWithInspectMetadata = Object.assign({}, OPTIONS, { inspectMetadata: true,