Skip to content

Commit

Permalink
only print logs if nol_sdkDebug === "debug"
Browse files Browse the repository at this point in the history
  • Loading branch information
wjoosen committed Aug 29, 2024
1 parent ecaa04b commit 44bc3e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nielsen/src/integration/NielsenHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const EMSG_PAYLOAD_SUFFIX = 'payload=';
export class NielsenHandler {
private player: ChromelessPlayer;

private debug: boolean;

private dcrEnabled: boolean;
private dtvrEnabled: boolean;
private country: NielsenCountry = NielsenCountry.US;
Expand All @@ -51,6 +53,7 @@ export class NielsenHandler {
configuration?: NielsenConfiguration
) {
this.player = player;
this.debug = options?.nol_sdkDebug === 'debug' ? true : false;
this.dcrEnabled = configuration?.enableDCR ?? false;
this.dtvrEnabled = configuration?.enableDTVR ?? true;
this.country = configuration?.country ?? NielsenCountry.US;
Expand All @@ -63,7 +66,8 @@ export class NielsenHandler {
switch (this.country) {
case NielsenCountry.US: {
const { type, vidtype, assetid, ...updateableParameters } = metadata;
console.log(`[NIELSEN] updateMetadata: ${{ type, vidtype, assetid }} will not be updated`);
if (this.debug)
console.log(`[NIELSEN] updateMetadata: ${{ type, vidtype, assetid }} will not be updated`);
this.nSdkInstance.ggPM('updateMetadata', updateableParameters);
break;
}
Expand Down

0 comments on commit 44bc3e5

Please sign in to comment.