Skip to content

Commit

Permalink
Fix #2956: Enable logging when aiohttp.web is used as a program
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed May 28, 2018
1 parent 0e11b36 commit b8764bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/2956.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable logging when ``aiohttp.web`` is used as a program
3 changes: 3 additions & 0 deletions aiohttp/web.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import logging
import socket
import sys
from argparse import ArgumentParser
Expand Down Expand Up @@ -177,6 +178,8 @@ def main(argv):
arg_parser.error("file system paths not supported by your operating"
" environment")

logging.basicConfig(level=logging.DEBUG)

This comment has been minimized.

Copy link
@gordio

gordio Jun 8, 2018

Why DEBUG?

This comment has been minimized.

Copy link
@kxepal

kxepal Jun 8, 2018

Member

I guess such way to run server is intended to be used for development at first. However, PR with log level choose or with path to logging config will be good one.

This comment has been minimized.

Copy link
@asvetlov

asvetlov Jun 8, 2018

Author Member

Agree with @kxepal
PR is welcome


app = func(extra_argv)
run_app(app, host=args.hostname, port=args.port, path=args.path)
arg_parser.exit(message="Stopped\n")
Expand Down

0 comments on commit b8764bb

Please sign in to comment.