From 8bdbf0ab6b2a85af974e81704de6df0f037c8932 Mon Sep 17 00:00:00 2001 From: messense Date: Sat, 25 Feb 2017 12:49:24 +0800 Subject: [PATCH] Remove sanic.log module --- examples/cache_example.py | 3 ++- examples/try_everything.py | 3 ++- sanic/__main__.py | 6 +++++- sanic/log.py | 3 --- 4 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 sanic/log.py diff --git a/examples/cache_example.py b/examples/cache_example.py index df56689f..60911cef 100644 --- a/examples/cache_example.py +++ b/examples/cache_example.py @@ -9,16 +9,17 @@ If you want more info about the package check https://github.com/argaen/aiocache """ +import logging import asyncio import aiocache from sanic import Sanic from sanic.response import json -from sanic.log import log from aiocache import cached from aiocache.serializers import JsonSerializer app = Sanic(__name__) +log = logging.getLogger(__name__) @app.listener('before_server_start') diff --git a/examples/try_everything.py b/examples/try_everything.py index f7191ecc..4df025dc 100644 --- a/examples/try_everything.py +++ b/examples/try_everything.py @@ -1,11 +1,12 @@ import os +import logging from sanic import Sanic -from sanic.log import log from sanic.response import json, text, file from sanic.exceptions import ServerError app = Sanic(__name__) +log = logging.getLogger(__name__) @app.route("/") diff --git a/sanic/__main__.py b/sanic/__main__.py index 5e13eba0..7a9e10cc 100644 --- a/sanic/__main__.py +++ b/sanic/__main__.py @@ -1,9 +1,13 @@ +import logging from argparse import ArgumentParser from importlib import import_module -from sanic.log import log from sanic.app import Sanic + +log = logging.getLogger('sanic') + + if __name__ == "__main__": parser = ArgumentParser(prog='sanic') parser.add_argument('--host', dest='host', type=str, default='127.0.0.1') diff --git a/sanic/log.py b/sanic/log.py deleted file mode 100644 index 1b4d7334..00000000 --- a/sanic/log.py +++ /dev/null @@ -1,3 +0,0 @@ -import logging - -log = logging.getLogger('sanic')