Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Logging does not work on debian squeeze #70

Closed
pgergo opened this Issue · 5 comments

4 participants

pgergo Jeremy Walker Martin Häcker Eevee
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.

Jeremy Walker

+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).

Jeremy Walker

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?

Jeremy Walker

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())

Martin Häcker
dwt commented

+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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.