diff launch @ 46:997d0c8c174f draft

Default for the launch callable should be not to log.
author David Barts <n5jrn@me.com>
date Thu, 30 May 2019 16:36:43 -0700
parents df27cf08c093
children 879ec681f7e3
line wrap: on
line diff
--- a/launch	Thu May 30 14:44:09 2019 -0700
+++ b/launch	Thu May 30 16:36:43 2019 -0700
@@ -7,6 +7,7 @@
 
 import os, sys
 from argparse import ArgumentParser
+import logging
 from tincan import launch, ENCODING
 
 # V a r i a b l e s
@@ -26,7 +27,10 @@
 opt("directory", default=".", help="directory to serve", nargs='?')
 opt("path", default="/", help="URL path to serve", nargs='?')
 args = parser.parse_args(sys.argv[1:])
-app, errors = launch(fsroot=args.directory, urlroot=args.path, debug=args.debug,
+mylog = logging.getLogger(MYNAME)
+mylog.addHandler(logging.StreamHandler())
+mylog.setLevel(logging.DEBUG if args.debug else logging.INFO)
+app, errors = launch(fsroot=args.directory, urlroot=args.path, logger=mylog,
     encoding=args.encoding, static=args.static)
 if errors:
     action = "continuing" if args.force else "aborting"