ConsoleLoggerService: Fix type of context properties

Nullish values of functionContext and classContext are handled correctly,
so the type can be adjusted

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-04-29 16:10:46 +02:00
parent 52bb44a561
commit 56ce66bc8b
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -14,7 +14,7 @@ import { needToLog } from '../config/utils';
@Injectable({ scope: Scope.TRANSIENT }) @Injectable({ scope: Scope.TRANSIENT })
export class ConsoleLoggerService { export class ConsoleLoggerService {
private classContext: string; private classContext: string | undefined;
private lastTimestamp: number; private lastTimestamp: number;
constructor( constructor(
@ -83,7 +83,7 @@ export class ConsoleLoggerService {
} }
} }
private makeContextString(functionContext: string): string { private makeContextString(functionContext?: string): string {
let context = this.classContext; let context = this.classContext;
if (!context) { if (!context) {
context = 'HedgeDoc'; context = 'HedgeDoc';