Skip to content

Commit

Permalink
feat(logging): add getter functions for logging interceptor fields
Browse files Browse the repository at this point in the history
  • Loading branch information
amarlankri committed Feb 15, 2024
1 parent 0ceeaa3 commit 7d100ea
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/logging-interceptor/src/logging.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ export class LoggingInterceptor implements NestInterceptor {
this.mask = options?.mask;
}

/**
* Return the user prefix
*/
public getUserPrefix(): string {
return this.userPrefix;
}

/**
* User prefix setter
* ex. [MyPrefix - LoggingInterceptor - 200 - GET - /]
Expand All @@ -84,6 +91,13 @@ export class LoggingInterceptor implements NestInterceptor {
this.userPrefix = `${prefix} - `;
}

/**
* Return the disable masking flag
*/
public getDisabledMasking(): boolean {
return this.disableMasking;
}

/**
* Set the disable masking flag
* @param disableMasking
Expand All @@ -92,6 +106,13 @@ export class LoggingInterceptor implements NestInterceptor {
this.disableMasking = disableMasking;
}

/**
* Return the masking placeholder
*/
public getMaskingPlaceholder(): string | undefined {
return this.maskingPlaceholder;
}

/**
* Set the masking placeholder
* @param placeholder
Expand All @@ -100,6 +121,13 @@ export class LoggingInterceptor implements NestInterceptor {
this.maskingPlaceholder = placeholder;
}

/**
* Return the masking options
*/
public getMask(): LoggingInterceptorMaskingOptions | undefined {
return this.mask;
}

/**
* Set the masking options
* @param mask
Expand Down

0 comments on commit 7d100ea

Please sign in to comment.