Closed
Description
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.
Refer to the logging in ImageAsset.image
and SystemImage.image
, except that we should use YCoreUI.colorLogger
.
- Log warning level message from
Colorable.color
if and only if returning the fallbackColor. - Don't log anything if
YCoreUI.isLoggingEnabled == false
- Use
YCoreUI.colorLogger
- Extract the code that builds name from namespace + rawValue into an internal
calculateName()
method and cover it in unit tests (seeImageAsset.calculateName()
and associated unit tests for reference). - warning message must contain the full name from
calculateName()
- In ColorableTests try to minimize use of logger. Ideally log only one message before disabling the logging for remainder of failure cases (but re-enable it at end of tests). See ImageAssetTests and SystemImageTests.
- Keep unit test coverage at 100%