Zum Inhalt springen

Duplicate Log Message (ARCH3162)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key typescript.logging.duplicate-log-message · Severity info · Category logging

Identical log message literals repeated within the same class or module make log lines ambiguous about their source. It becomes impossible to tell which code path emitted them.

function transfer(from: string, to: string) {
if (!accounts.has(from)) logger.warn("invalid account");
if (!accounts.has(to)) logger.warn("invalid account");
}
function transfer(from: string, to: string) {
if (!accounts.has(from)) logger.warn("invalid source account", { account: from });
if (!accounts.has(to)) logger.warn("invalid target account", { account: to });
}

Make each log call unique with a distinguishing message and context.