Skip to content

Commit

Permalink
[MOB-36409] Добавляет различий в логгировании кейсов ZpDay и Night пр…
Browse files Browse the repository at this point in the history
…и резолве токенов
  • Loading branch information
PStrelchenko committed Feb 7, 2024
1 parent c477340 commit 743ba47
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ final class DefaultColorTokensContextProvider: ColorTokensContextProvider {

// MARK: - Instance Methods

private func fallbackWarning(tokenName: String) {
logger.warning("Night value for token '\(tokenName)' not found, using day value.")
private func fallbackWarning(warningPrefix: String, tokenName: String) {
logger.warning("\(warningPrefix) value for token '\(tokenName)' not found, using day value.")
}

private func resolveNightValue(
Expand All @@ -24,12 +24,12 @@ final class DefaultColorTokensContextProvider: ColorTokensContextProvider {
tokenValues: TokenValues
) throws -> String {
guard let nightToken = tokenValues.hhNight.first(where: { $0.name == tokenName }) else {
fallbackWarning(tokenName: tokenName)
fallbackWarning(warningPrefix: "Night", tokenName: tokenName)
return fallbackValue
}

guard case .color(let nightValue) = nightToken.type else {
fallbackWarning(tokenName: tokenName)
fallbackWarning(warningPrefix: "Night", tokenName: tokenName)
return fallbackValue
}

Expand All @@ -46,12 +46,12 @@ final class DefaultColorTokensContextProvider: ColorTokensContextProvider {
tokenValues: TokenValues
) throws -> String {
guard let nightToken = tokenValues.hhNight.first(where: { $0.name == tokenName }) else {
fallbackWarning(tokenName: tokenName)
fallbackWarning(warningPrefix: "Night", tokenName: tokenName)
return fallbackRefence
}

guard case .color(let nightValue) = nightToken.type else {
fallbackWarning(tokenName: tokenName)
fallbackWarning(warningPrefix: "Night", tokenName: tokenName)
return fallbackRefence
}

Expand All @@ -64,12 +64,12 @@ final class DefaultColorTokensContextProvider: ColorTokensContextProvider {
tokenValues: TokenValues
) throws -> String {
guard let zpDayToken = tokenValues.hhNight.first(where: { $0.name == tokenName }) else {
fallbackWarning(tokenName: tokenName)
fallbackWarning(warningPrefix: "ZpDay", tokenName: tokenName)
return fallbackValue
}

guard case .color(let zpDayValue) = zpDayToken.type else {
fallbackWarning(tokenName: tokenName)
fallbackWarning(warningPrefix: "ZpDay", tokenName: tokenName)
return fallbackValue
}

Expand All @@ -86,12 +86,12 @@ final class DefaultColorTokensContextProvider: ColorTokensContextProvider {
tokenValues: TokenValues
) throws -> String {
guard let zpDayToken = tokenValues.zpDay.first(where: { $0.name == tokenName }) else {
fallbackWarning(tokenName: tokenName)
fallbackWarning(warningPrefix: "ZpDay", tokenName: tokenName)
return fallbackRefence
}

guard case .color(let zpDayValue) = zpDayToken.type else {
fallbackWarning(tokenName: tokenName)
fallbackWarning(warningPrefix: "ZpDay", tokenName: tokenName)
return fallbackRefence
}

Expand Down

0 comments on commit 743ba47

Please sign in to comment.