From 4f40e9ee7145236dab473d1527b7af8b8718659e Mon Sep 17 00:00:00 2001 From: Marcin Baran Date: Mon, 9 Jan 2017 16:59:25 +0100 Subject: [PATCH] Disable sanic logo --- docs/deploying.md | 13 +++++++++++++ sanic/sanic.py | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/deploying.md b/docs/deploying.md index d759bb3c..2375b1b9 100644 --- a/docs/deploying.md +++ b/docs/deploying.md @@ -32,4 +32,17 @@ like so: ```python if __name__ == '__main__': app.run(host='0.0.0.0', port=1337, workers=4) +``` + +## Disable Sanic logo + +```python +from sanic.config import Config + + +class MyConfig(Config): + LOGO = '' + + +app = Sanic(__name__, config=MyConfig()) ``` \ No newline at end of file diff --git a/sanic/sanic.py b/sanic/sanic.py index 3dab3e47..02e95052 100644 --- a/sanic/sanic.py +++ b/sanic/sanic.py @@ -21,7 +21,7 @@ from os import set_inheritable class Sanic: def __init__(self, name=None, router=None, - error_handler=None, logger=None): + error_handler=None, logger=None, config=None): if logger is None: logging.basicConfig( level=logging.INFO, @@ -33,7 +33,7 @@ class Sanic: self.name = name self.router = router or Router() self.error_handler = error_handler or Handler(self) - self.config = Config() + self.config = config or Config() self.request_middleware = deque() self.response_middleware = deque() self.blueprints = {}