Skip to content

Commit

Permalink
tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
terehov committed Nov 24, 2020
1 parent 9a58d6c commit d4bcdf2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/LoggerHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
export class LoggerHelper {
public static cwdArray: string[] = process.cwd().split(pathSeparator);

// eslint-disable-next-line @rushstack/no-new-null
public static cleanUpFilePath(fileName: string | null): string | null {
return fileName == null
? fileName
Expand Down Expand Up @@ -222,6 +223,7 @@ export class LoggerHelper {
public static _getCodeFrame(
filePath: string,
lineNumber: number,
// eslint-disable-next-line @rushstack/no-new-null
columnNumber: number | null,
linesBeforeAndAfter: number
): ICodeFrame | undefined {
Expand Down
15 changes: 7 additions & 8 deletions src/LoggerWithoutCallSite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export class LoggerWithoutCallSite {
private _mySettings: ISettingsParam = {};
private _childLogger: Logger[] = [];
private _maskAnyRegExp: RegExp | undefined;
protected _callSiteWrapper: (callSite: NodeJS.CallSite) => NodeJS.CallSite = (
callSite: NodeJS.CallSite
) => callSite;

/**
* @param settings - Configuration of the logger instance (all settings are optional with sane defaults)
Expand Down Expand Up @@ -175,7 +172,8 @@ export class LoggerWithoutCallSite {

this._maskAnyRegExp =
this.settings.maskAnyRegEx?.length > 0
? new RegExp(Object.values(this.settings.maskAnyRegEx).join("|"), "g")
? // eslint-disable-next-line @rushstack/security/no-unsafe-regexp
new RegExp(Object.values(this.settings.maskAnyRegEx).join("|"), "g")
: undefined;

LoggerHelper.setUtilsInspectStyles(
Expand All @@ -202,10 +200,7 @@ export class LoggerWithoutCallSite {
const childSettings: ISettings = {
...this.settings,
};
const childLogger: Logger = new (this.constructor as any)(
settings,
childSettings
);
const childLogger: Logger = new Logger(settings, childSettings);
this._childLogger.push(childLogger);
return childLogger;
}
Expand Down Expand Up @@ -313,6 +308,10 @@ export class LoggerWithoutCallSite {
return errorObject;
}

protected _callSiteWrapper: (callSite: NodeJS.CallSite) => NodeJS.CallSite = (
callSite: NodeJS.CallSite
) => callSite;

private _handleLog(
logLevel: TLogLevelName,
logArguments: unknown[],
Expand Down

0 comments on commit d4bcdf2

Please sign in to comment.