Skip to content

Commit

Permalink
Format source
Browse files Browse the repository at this point in the history
  • Loading branch information
terehov committed Jun 8, 2024
1 parent f9fc041 commit 8190017
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ For `pretty` logs:
For `JSON` logs (no formatting happens here):
```typescript
const logger = new Logger({
type: "pretty",
type: "json",
overwrite: {
transportJSON: (logObjWithMeta: any) => {
// transport the LogObj to console, StdOut, a file or an external service
Expand Down
14 changes: 7 additions & 7 deletions src/BaseLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ export class BaseLogger<LogObj> {
return Object.getOwnPropertyNames(source).reduce((o, prop) => {
o[prop] = keys.includes(this.settings?.maskValuesOfKeysCaseInsensitive !== true ? prop : prop.toLowerCase())
? this.settings.maskPlaceholder
: (()=>{
try{
return this._recursiveCloneAndMaskValuesOfKeys((source as Record<string, unknown>)[prop], keys, seen);
}catch(e){
return null;
}
})();
: (() => {
try {
return this._recursiveCloneAndMaskValuesOfKeys((source as Record<string, unknown>)[prop], keys, seen);
} catch (e) {
return null;
}
})();
return o;
}, baseObject) as T;
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/runtime/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export function getCallerStackFrame(stackDepthLevel: number, error: Error = Erro
}

export function getErrorTrace(error: Error): IStackFrame[] {
return ((error as Error)?.stack
?.split("\n") ?? [])
return ((error as Error)?.stack?.split("\n") ?? [])
?.filter((line: string) => !line.includes("Error: "))
?.reduce((result: IStackFrame[], line: string) => {
result.push(stackLineToStackFrame(line));
Expand Down

0 comments on commit 8190017

Please sign in to comment.