Skip to content

Commit

Permalink
fix(logging): print options in json instead of using a helper
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyJones committed Aug 19, 2019
1 parent b11ddde commit 9f09348
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/pact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import messageFactory, { MessageOptions } from './message';
import publisherFactory, { PublisherOptions } from './publisher';
import canDeployFactory, { CanDeployOptions } from './can-deploy';
import pactUtil from './pact-util';
import argsHelper, { SpawnArguments } from './spawn-arguments';
import logger, { LogLevels } from './logger';
import { AbstractService } from './service';
import * as _ from 'underscore';
Expand Down Expand Up @@ -60,17 +59,13 @@ export class Pact {
let server = serverFactory(options);
this.__servers.push(server);
logger.info(
`Creating Pact Server with options: \n${argsHelper.stringifySpawnArguments(
server.options as SpawnArguments,
)}`,
`Creating Pact Server with options: \n${JSON.stringify(server.options)}`,
);

// Listen to server delete events, to remove from server list
server.once(AbstractService.Events.DELETE_EVENT, (s: Server) => {
logger.info(
`Deleting Pact Server with options: \n${argsHelper.stringifySpawnArguments(
s.options as SpawnArguments,
)}`,
`Deleting Pact Server with options: \n${JSON.stringify(s.options)}`,
);
this.__servers = _.without(this.__servers, s);
});
Expand Down Expand Up @@ -114,17 +109,13 @@ export class Pact {
let stub = stubFactory(options);
this.__stubs.push(stub);
logger.info(
`Creating Pact Stub with options: \n${argsHelper.stringifySpawnArguments(
stub.options as SpawnArguments,
)}`,
`Creating Pact Stub with options: \n${JSON.stringify(stub.options)}`,
);

// Listen to stub delete events, to remove from stub list
stub.once(AbstractService.Events.DELETE_EVENT, (s: Stub) => {
logger.info(
`Deleting Pact Stub with options: \n${argsHelper.stringifySpawnArguments(
s.options as SpawnArguments,
)}`,
`Deleting Pact Stub with options: \n${JSON.stringify(stub.options)}`,
);
this.__stubs = _.without(this.__stubs, s);
});
Expand Down

0 comments on commit 9f09348

Please sign in to comment.