question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

importing swifter hijacks logging

See original GitHub issue

If 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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jmcarpenter2commented, Oct 27, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found