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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Configuration/Multi-Installation to Built-ins #149

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ranelpadon
Copy link

@ranelpadon ranelpadon commented Jun 19, 2023

Thanks for this awesome tool! :)

I usually have these use cases when working with our Python/Django projects:

  • printing to terminal: ic() with context and custom prefix
  • piping to logger: ic() without context and prefix

But currently, these 2 cases could not exist at the same time since configureOutput() is being applied on the same ic object.

Figured out that an effective solution is to have a way to create multiple instances of IceCream wherein each of them could have different configurations and could be added in builtins with different names (e.g. ic() and ik()):

  • printing to terminal: ic() with context and custom prefix
  • piping to logger: ik() without context and prefix

Hence, created this PR. I use the code changes here in our projects for some time already and it's working as intended. Likewise, updated the unit tests and README. Cheers!

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.

1 participant