All files / redis-smq-monitor/src/lib logger.ts

83.33% Statements 5/6
75% Branches 3/4
66.66% Functions 2/3
83.33% Lines 5/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  57x       33x             57x       57x       33x    
import { TConfig } from '../../types';
import { logger } from 'redis-smq-common';
import { ICompatibleLogger, TLoggerConfig } from 'redis-smq-common/dist/types';
 
function getConfigParams(config: TConfig): TLoggerConfig {
  return (
    config.logger ?? {
      enabled: true,
    }
  );
}
 
export function getLoggerInstance(config: TConfig): ICompatibleLogger {
  return logger.getLogger(getConfigParams(config));
}
 
export function getNamespacedLoggerInstance(
  config: TConfig,
  namespace: string,
): ICompatibleLogger {
  return logger.getNamespacedLogger(getConfigParams(config), namespace);
}