importing swifter hijacks logging
See original GitHub issueIf I am logging to console or file, just the act of importing swifter stops all logging.
I have tested this in a fresh colab with only swifter installed, and it is also the case with logging.handlers.RotatingFileHandler
MWE:
import logging
import pandas as pd
logger = logging.getLogger('myapp')
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
formatter = '[%(levelname)s] - %(asctime)s : %(message)s'
handler.setFormatter(logging.Formatter(formatter))
logger.addHandler(handler)
logger.debug('message')
[DEBUG] - 2020-10-22 23:00:12,202 : message
pip install -q swifter
import swifter
logger.debug('message after importing swifter')
[no output]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top Results From Across the Web
jmcarpenter2/swifter - GitHub
A package which efficiently applies any function to a pandas dataframe or series in the fastest available manner - GitHub - jmcarpenter2/swifter: A...
Read more >Swifter 1.0.0: automatically efficient pandas and modin ...
Swifter apply performance benchmark log-log plot. ... It's as simple as changing your import statement. import modin.pandas as pd
Read more >Speed up your Pandas Processing with Swifter
Let's try it. Import numpy as np#Using np.where to implement vectorized function def scoring_comment_vectorized(x): return np.where(x ...
Read more >Python logging hijack sub-module logs to another file (Pylons)
I have a pylons app myapp and I need all log messages from a submodule myapp.lib.submodule to be written to a different log...
Read more >Swiffer Sweeper Heavy Duty Pet Dry Sweeping Cloth Refills
Thrifting Tips from a Secondhand Shopping Pro. Thrifting for clothes. Good Will, Salvation Army and stores like Savers will offer the most bargains...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @gkennos , thanks for raising this!
This is definitely concerning. Let me look into resolving this. The original purpose of disabling logging for swifter was to avoid repeated logging during swifter’s applies. See #130 for a discussion. I’ll follow-up here when I have a solution.
Thanks, Jason
Removed the line https://github.com/jmcarpenter2/swifter/blob/01ac2ea99e3ddaf7a3a5846ab8e0d1f96236dab1/swifter/__init__.py#L8 from
swifter==1.0.8
#156