Created
December 25, 2012 23:31
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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