src/logging/decorators/InjectLogger.ts   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 3

Size

Lines of Code 15
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 7
mnd 2
bc 2
fnc 1
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
bpm 2
cpm 3
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A InjectLogger.ts ➔ InjectLogger 0 10 3
1 4
import { logger } from '@/core';
2 4
import Logger from '@/logging/Logger';
3
4
/**
5
 * Initializes a Logger with a specified prefix message
6
 * @decorator
7
 * @param scope {string}
8
 */
9 4
export function InjectLogger(scope?: string) {
10 2
  return (_value: any, _context: ClassFieldDecoratorContext) => () => {
11 3
    logger.debug(`initializing ${scope ?? 'anonymous'} logger`);
12 3
    return Logger(scope);
13
  };
14
}
15