Skip to content

Extracted LoggerType#2098

Merged
NachoSoto merged 1 commit into
mainfrom
logger-type
Dec 7, 2022
Merged

Extracted LoggerType#2098
NachoSoto merged 1 commit into
mainfrom
logger-type

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Nov 29, 2022

Copy link
Copy Markdown
Contributor

This will be used to inject a logger into ReceiptParser (CSDK-17).

@NachoSoto NachoSoto requested a review from a team November 29, 2022 19:58
@NachoSoto NachoSoto force-pushed the logger-type branch 3 times, most recently from 545629b to 6b73cb6 Compare November 29, 2022 20:51
This will be used to inject a logger into `ReceiptParser` ([CSDK-17]).
import Foundation

/// A type that can receive logs of different levels.
protocol LoggerType {

@aboedo aboedo Dec 7, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is a pattern that I wish we had used a lot more in the codebase, the inherit + replace approach feels more cumbersome and dangerous to me (dangerous because you could forget to replace a function in the mock and it gets called in the parent)

@NachoSoto NachoSoto merged commit 1030cf2 into main Dec 7, 2022
@NachoSoto NachoSoto deleted the logger-type branch December 7, 2022 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants