From eb4276373bac79de1c4a1a5d07e308853a57d430 Mon Sep 17 00:00:00 2001 From: TheRubyDoggy Date: Sat, 24 Mar 2018 15:34:41 +0200 Subject: [PATCH 1/2] Fix try_everything example. --- examples/try_everything.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/try_everything.py b/examples/try_everything.py index 76967be1..bc0fa8a0 100644 --- a/examples/try_everything.py +++ b/examples/try_everything.py @@ -1,7 +1,7 @@ import os from sanic import Sanic -from sanic.log import log +from sanic.log import logger from sanic import response from sanic.exceptions import ServerError @@ -82,22 +82,22 @@ def query_string(request): @app.listener('before_server_start') def before_start(app, loop): - log.info("SERVER STARTING") + logger.info("SERVER STARTING") @app.listener('after_server_start') def after_start(app, loop): - log.info("OH OH OH OH OHHHHHHHH") + logger.info("OH OH OH OH OHHHHHHHH") @app.listener('before_server_stop') def before_stop(app, loop): - log.info("SERVER STOPPING") + logger.info("SERVER STOPPING") @app.listener('after_server_stop') def after_stop(app, loop): - log.info("TRIED EVERYTHING") + logger.info("TRIED EVERYTHING") if __name__ == '__main__': From 2995b2392941d088fc2a25738be8d489dfc3865d Mon Sep 17 00:00:00 2001 From: PyManiac <11256310+PyManiacGR@users.noreply.github.com> Date: Sat, 24 Mar 2018 15:55:15 +0200 Subject: [PATCH 2/2] Update try_everything.py --- examples/try_everything.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/try_everything.py b/examples/try_everything.py index bc0fa8a0..5950c4ea 100644 --- a/examples/try_everything.py +++ b/examples/try_everything.py @@ -1,7 +1,7 @@ import os from sanic import Sanic -from sanic.log import logger +from sanic.log import logger as log from sanic import response from sanic.exceptions import ServerError @@ -82,22 +82,22 @@ def query_string(request): @app.listener('before_server_start') def before_start(app, loop): - logger.info("SERVER STARTING") + log.info("SERVER STARTING") @app.listener('after_server_start') def after_start(app, loop): - logger.info("OH OH OH OH OHHHHHHHH") + log.info("OH OH OH OH OHHHHHHHH") @app.listener('before_server_stop') def before_stop(app, loop): - logger.info("SERVER STOPPING") + log.info("SERVER STOPPING") @app.listener('after_server_stop') def after_stop(app, loop): - logger.info("TRIED EVERYTHING") + log.info("TRIED EVERYTHING") if __name__ == '__main__':