Skip to content

Commit

Permalink
replaced console.log with logger.debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchiramoitra committed Jul 30, 2020
1 parent a6b0100 commit 1dc8eda
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
8 changes: 4 additions & 4 deletions integrations/GA/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe("GA init tests", () => {
},
},
});
console.log(JSON.stringify(window.ga.mock.calls)); // this has set with empty {} object when resetCustomDimensions
logger.debug(JSON.stringify(window.ga.mock.calls)); // this has set with empty {} object when resetCustomDimensions
expect(window.ga.mock.calls[0][0]).toEqual("set");
expect(window.ga.mock.calls[0][1]).toEqual({"dimension1":null})
expect(window.ga.mock.calls[1][0]).toEqual("set");
Expand All @@ -90,7 +90,7 @@ describe("GA init tests", () => {
title: "test cat",
location: "http://localhost",
});
console.log(JSON.stringify(window.ga.mock.calls));
logger.debug(JSON.stringify(window.ga.mock.calls));
// TODO: call another page, check location not set
});
});
Expand Down Expand Up @@ -119,7 +119,7 @@ describe("GA init tests", () => {
},
},
});
// console.log(JSON.stringify(window.ga.mock.calls));
// logger.debug(JSON.stringify(window.ga.mock.calls));

expect(window.ga.mock.calls[0][0]).toEqual("send");
expect(window.ga.mock.calls[0][1]).toEqual("event");
Expand All @@ -146,7 +146,7 @@ describe("GA init tests", () => {
},
},
});
// console.log(JSON.stringify(window.ga.mock.calls));
// logger.debug(JSON.stringify(window.ga.mock.calls));

expect(window.ga.mock.calls[0][0]).toEqual("send");
expect(window.ga.mock.calls[0][1]).toEqual("event");
Expand Down
16 changes: 8 additions & 8 deletions integrations/GA/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@ class GANode {
}

init() {
console.log("===in GA Node init===");
logger.debug("===in GA Node init===");

// this.client = ua(this.trackingID, "6a14abda-6b12-4578-bf66-43c754eaeda9");
}

identify(rudderElement) {
console.log("=== in GA Node identify===");
logger.debug("=== in GA Node identify===");
this.client = ua(this.trackingID, rudderElement.message.userId);
}

track(rudderElement) {
console.log("=== in GA Node track===");
logger.debug("=== in GA Node track===");
this.client.event(
rudderElement.message.type,
rudderElement.message.event,
function (err) {
// Handle the error if necessary.
// In case no error is provided you can be sure
// the request was successfully sent off to Google.
console.log(`error sending to GA${err}`);
logger.debug(`error sending to GA${err}`);
}
);
}

page(rudderElement) {
console.log("=== in GA Node page===");
logger.debug("=== in GA Node page===");
if (
rudderElement.message.properties &&
rudderElement.message.properties.path
Expand All @@ -47,15 +47,15 @@ class GANode {
// Handle the error if necessary.
// In case no error is provided you can be sure
// the request was successfully sent off to Google.
console.log(`error sending to GA${err}`);
logger.debug(`error sending to GA${err}`);
});
// this.client.pageview(rudderElement.message.properties.path).send();
}
}

loaded() {
console.log("in GA isLoaded");
console.log("node not supported");
logger.debug("in GA isLoaded");
logger.debug("node not supported");
}
}

Expand Down
14 changes: 7 additions & 7 deletions integrations/GoogleAds/node.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
class GoogleAdsNode {
constructor() {
console.log("nothing to construct");
logger.debug("nothing to construct");
}

init() {
console.log("node not supported");
logger.debug("node not supported");

console.log("===in init===");
logger.debug("===in init===");
}

identify(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

track(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

page(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

loaded() {
console.log("node not supported");
logger.debug("node not supported");
}
}

Expand Down
16 changes: 8 additions & 8 deletions integrations/Hotjar/node.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
class HotjarNode {
constructor() {
console.log("nothing to construct");
logger.debug("nothing to construct");
}

init() {
console.log("node not supported");
logger.debug("node not supported");

console.log("===in init===");
logger.debug("===in init===");
}

identify(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

track(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

page(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

loaded() {
console.log("in hubspot isLoaded");
console.log("node not supported");
logger.debug("in hubspot isLoaded");
logger.debug("node not supported");
}
}

Expand Down
16 changes: 8 additions & 8 deletions integrations/HubSpot/node.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
class HubSpotNode {
constructor() {
console.log("nothing to construct");
logger.debug("nothing to construct");
}

init() {
console.log("node not supported");
logger.debug("node not supported");

console.log("===in init===");
logger.debug("===in init===");
}

identify(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

track(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

page(rudderElement) {
console.log("node not supported");
logger.debug("node not supported");
}

loaded() {
console.log("in hubspot isLoaded");
console.log("node not supported");
logger.debug("in hubspot isLoaded");
logger.debug("node not supported");
}
}

Expand Down

0 comments on commit 1dc8eda

Please sign in to comment.