Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

[ISSUE] Add logger to colorable on fallBack#62

Merged
SahilSainiYML merged 2 commits into
mainfrom
issue/CM-1324-AddLoggerToFallBackColor
Apr 11, 2023
Merged

[ISSUE] Add logger to colorable on fallBack#62
SahilSainiYML merged 2 commits into
mainfrom
issue/CM-1324-AddLoggerToFallBackColor

Conversation

@SahilSainiYML

@SahilSainiYML SahilSainiYML commented Apr 11, 2023

Copy link
Copy Markdown
Contributor

Introduction

Our Colorable protocol helps users load (and unit test) colors from asset catalogs. It provides a fallback color to use in case the named color asset cannot be found. In that case though we should log a warning message.
Extract the code that builds name from namespace + rawValue into an internal calculateName() method and cover it in unit tests.
In ColorableTests try to minimize use of logger. Ideally log only one message before disabling the logging for remainder of failure cases

Purpose

Add logger to colorable protocol and add unit test for above scenarios.
Fix #55

Scope

Colorable protocol and Unit test for same protocol.

📈 Coverage

Code

100%
Code coverage

Documentation

100%
Jazzy

@mpospese mpospese left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I updated the comments on the protocol and the default implementation so that the generated documentation looks good and does not have duplicates.
image

@SahilSainiYML
SahilSainiYML merged commit 38f2a28 into main Apr 11, 2023
@SahilSainiYML
SahilSainiYML deleted the issue/CM-1324-AddLoggerToFallBackColor branch April 11, 2023 11:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Log warning message when Colorable.color uses the fallback color

2 participants