Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] Add logger to colorable on fallBack #62

Merged
merged 2 commits into from Apr 11, 2023

Conversation

SahilSainiYML
Copy link
Contributor

@SahilSainiYML SahilSainiYML commented Apr 11, 2023

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

Copy link
Contributor

@mpospese mpospese left a comment

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
1 check passed
@SahilSainiYML SahilSainiYML deleted the issue/CM-1324-AddLoggerToFallBackColor branch April 11, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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