1
0
mirror of https://github.com/pypiserver/pypiserver synced 2024-11-09 16:45:51 +01:00

FIX #81: Move defaults from log-options so they are not ovewritten on startup.

This commit is contained in:
ankostis on tokoti 2015-03-16 01:25:51 +01:00 committed by Kostis Anagnostopoulos at STUW025
parent 555ed130f0
commit e579abdd4e
3 changed files with 17 additions and 15 deletions

@ -249,7 +249,7 @@ Running ``pypi-server -h`` will print a detailed usage message::
uses the ASCII contents of HTML_FILE as welcome message response.
-v
enable INFO logging; repeate for more verbosity.
enable INFO logging; repeat for more verbosity.
--log-conf <FILE>
read logging configuration from FILE.

@ -7,14 +7,15 @@ def app(root=None,
fallback_url=None,
authenticated=None,
password_file=None,
overwrite=False,
log_req_frmt="%(bottle.request)s",
log_res_frmt="%(status)s",
log_err_frmt="%(body)s: %(exception)s \n%(traceback)s",
overwrite=None,
log_req_frmt=None,
log_res_frmt=None,
log_err_frmt=None,
welcome_file=None,
cache_control=None,
):
import sys, os
import sys
import os
from pypiserver import core
sys.modules.pop("pypiserver._app", None)
__import__("pypiserver._app")
@ -55,7 +56,8 @@ def paste_app_factory(global_config, **local_conf):
else:
roots = None
redirect_to_fallback = local_conf.get("redirect_to_fallback", "").lower() in ("yes", "on", "1")
redirect_to_fallback = local_conf.get(
"redirect_to_fallback", "").lower() in ("yes", "on", "1")
fallback_url = local_conf.get("fallback_url")
password_file = local_conf.get("password_file")
return app(root=roots, redirect_to_fallback=redirect_to_fallback, fallback_url=fallback_url, password_file=password_file)

@ -242,7 +242,7 @@ pypi-server understands the following options:
uses the ASCII contents of HTML_FILE as welcome message response.
-v
enable verbose logging; repeate for more verbosity.
enable verbose logging; repeat for more verbosity.
--log-file <FILE>
write logging info into this FILE.
@ -314,10 +314,10 @@ def main(argv=None):
overwrite = False
verbosity = 1
log_file = None
log_frmt = None
log_req_frmt = None
log_res_frmt = None
log_err_frmt = None
log_frmt = "g%(asctime)s|%(levelname)s|%(thread)d|%(message)s"
log_req_frmt = "%(bottle.request)s"
log_res_frmt = "%(status)s"
log_err_frmt = "%(body)s: %(exception)s \n%(traceback)s"
welcome_file = None
cache_control = None