Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Adding an option to pserver to add debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Navarro Bosch committed Dec 26, 2016
1 parent c425e63 commit ffdc4fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/plone.server/plone/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import argparse
import json
# import logging
import logging


# logger = logging.getLogger('plone.server')
Expand All @@ -18,10 +18,18 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--configuration',
default='config.json', help='Configuration file')
parser.add_argument('--debug', dest='debug', action='store_true',
help='Log verbose')
parser.set_defaults(debug=False)
arguments = parser.parse_args()

with open(arguments.configuration, 'r') as config:
settings = json.load(config)

if arguments.debug:
logging.basicConfig(
level=logging.DEBUG)

web.run_app(make_app(
config_file=arguments.configuration), port=settings['address'])

Expand Down

0 comments on commit ffdc4fc

Please sign in to comment.