Skip to content

Instantly share code, notes, and snippets.

@paxan
Created December 25, 2012 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paxan/4376330 to your computer and use it in GitHub Desktop.
Save paxan/4376330 to your computer and use it in GitHub Desktop.
Try "gunicorn --logger-class mylogger.MyLogger mylogger:app" for both cases: Exhibit A and Exhibit B. Also observe that when you do "python mylogger.py" you will get "AttributeError: 'module' object has no attribute 'glogging'" in the case of Exhibit A.
if True:
import gunicorn # Exhibit A
else:
import gunicorn.glogging # Exhibit B
class MyLogger(gunicorn.glogging.Logger):
pass
def app(environ, start_response):
data = "Hello, World!\n"
start_response("200 OK", [("Content-Type", "text/plain"),
("Content-Length", str(len(data)))])
yield data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment