تخطَّ إلى المحتوى

Duplicate Log Message (ARCH3162)

هذا المحتوى غير متوفر بلغتك بعد.

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.