Logging does not work on debian squeeze #70

Closed
pgergo opened this Issue Apr 16, 2012 · 5 comments

4 participants

@pgergo

I installed pyscss using 'pip install pyscss', and instead of seeing any messages, only the line

No handlers could be found for logger "scss"

is printed. After digging into the code, and putting the 'logging.basicConfig' call before 'logging.getLogger', it seems to work. I'm not sure about the internals of the logging module, but this seems to be the correct initialization order.

@machineghost

+1/me too, on Linux Mint 12 Lisa (which is basically just Ubuntu). Pgergo's "fix" of moving line 5423 of init.py to line 66 worked for me, but this is a non-starter for us because we use Pip for our deployments (and we really don't want to have manually patch every server).

@machineghost

P.S. I went to fork and make a pull request, only to discover that init.py is already fixed in master. I assume that change fixes this issue (intentionally or not), so kudos to the dev team, but ... can we get a pip-release now please?

@machineghost

My boss suggested that I try just making a logger to placate PyScss, and sure enough it worked. So, for anyone looking for a fix for this issue (before the devs release their fix) you can solve it by just adding the following to your code (before you import scss):

import logging
logging.getLogger("scss").addHandler(logging.StreamHandler())

@dwt
dwt commented Jun 5, 2012

+1 for a release

@eevee
Collaborator

This is more or less intended. If the library configured its own logging, it could interfere with your application's ability to do so.

Very easy solution if you don't care about logging:

import logging
logging.basicConfig()

I hope to rely less on the logging system and throw more exceptions with #139, anyway.

@eevee eevee closed this May 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment