Disable sanic logo

This commit is contained in:
Marcin Baran 2017-01-09 16:59:25 +01:00
parent d93da2c1a6
commit 4f40e9ee71
2 changed files with 15 additions and 2 deletions

View File

@ -33,3 +33,16 @@ like so:
if __name__ == '__main__': if __name__ == '__main__':
app.run(host='0.0.0.0', port=1337, workers=4) 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())
```

View File

@ -21,7 +21,7 @@ from os import set_inheritable
class Sanic: class Sanic:
def __init__(self, name=None, router=None, def __init__(self, name=None, router=None,
error_handler=None, logger=None): error_handler=None, logger=None, config=None):
if logger is None: if logger is None:
logging.basicConfig( logging.basicConfig(
level=logging.INFO, level=logging.INFO,
@ -33,7 +33,7 @@ class Sanic:
self.name = name self.name = name
self.router = router or Router() self.router = router or Router()
self.error_handler = error_handler or Handler(self) self.error_handler = error_handler or Handler(self)
self.config = Config() self.config = config or Config()
self.request_middleware = deque() self.request_middleware = deque()
self.response_middleware = deque() self.response_middleware = deque()
self.blueprints = {} self.blueprints = {}