MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / shouldOutput

Function shouldOutput

packages/utils/src/logger.ts:78–87  ·  view source on GitHub ↗
(
    logLevel: string,
    targetLevel: string = 'warn',
    bizName: string,
    targetBizName: string,
  )

Source from the content-addressed store, hash-verified

76const bizNameColorConfig: Record<string, string> = {};
77
78const shouldOutput = (
79 logLevel: string,
80 targetLevel: string = 'warn',
81 bizName: string,
82 targetBizName: string,
83 ): boolean => {
84 const isLevelFit = (levels as any)[targetLevel] <= (levels as any)[logLevel];
85 const isBizNameFit = targetBizName === '*' || bizName.indexOf(targetBizName) > -1;
86 return isLevelFit && isBizNameFit;
87};
88
89const output = (logLevel: string, bizName: string) => {
90 return (...args: any[]) => {

Callers 5

debugMethod · 0.85
logMethod · 0.85
infoMethod · 0.85
warnMethod · 0.85
errorMethod · 0.85

Calls 1

indexOfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…