Skip to content

Commit

Permalink
feat: add support for apiEndpoint override (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Jun 21, 2019
1 parent b202975 commit 6666276
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/types/core.d.ts
Expand Up @@ -103,6 +103,8 @@ export interface Options {
prefix?: string;

labels?: {[key: string]: string};

apiEndpoint?: string;
}

export interface MonitoredResource {
Expand Down
7 changes: 7 additions & 0 deletions test/index.ts
Expand Up @@ -72,6 +72,7 @@ describe('logging-winston', () => {
serviceContext: {
service: 'fake-service',
},
apiEndpoint: 'fake.local',
};

beforeEach(() => {
Expand All @@ -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,
Expand Down

0 comments on commit 6666276

Please sign in to comment.