Add magic debug values via cli
This commit is contained in:
parent
93fd03e717
commit
c2df56e15e
|
@ -6,4 +6,4 @@ git pull
|
|||
|
||||
pipenv install -r requirements.txt
|
||||
|
||||
pipenv run python -m houston
|
||||
pipenv run python -m houston -v
|
||||
|
|
|
@ -3,12 +3,28 @@
|
|||
# Kitsune Scientific
|
||||
|
||||
import logging
|
||||
import argparse
|
||||
import verboselogs
|
||||
import coloredlogs
|
||||
|
||||
from houston.houston import Houston
|
||||
|
||||
|
||||
# Get debug args
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'-d', '--debug',
|
||||
help="Print lots of debugging statements",
|
||||
action="store_const", dest="loglevel", const='DEBUG',
|
||||
default='WARNING',
|
||||
)
|
||||
parser.add_argument(
|
||||
'-v', '--verbose',
|
||||
help="Be verbose",
|
||||
action="store_const", dest="loglevel", const='INFO',
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Install verbose logs
|
||||
verboselogs.install()
|
||||
|
||||
|
@ -16,7 +32,7 @@ verboselogs.install()
|
|||
logger = logging.getLogger('Houston_Log')
|
||||
|
||||
# Install colored logs
|
||||
coloredlogs.install(level='INFO',
|
||||
coloredlogs.install(level=args.loglevel,
|
||||
logger=logger,
|
||||
fmt='%(asctime)s,%(msecs)03d %(hostname)s %(levelname)s %(message)s') # noqa: E501
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
import time
|
||||
|
||||
import houston.robotstreamer.streamer
|
||||
from houston.robotstreamer.streamer import RobotStreamer
|
||||
|
||||
|
||||
class Houston:
|
||||
|
@ -12,10 +12,15 @@ class Houston:
|
|||
# Setup logger
|
||||
self.log = logger
|
||||
|
||||
# Setup robotstreamer
|
||||
self.rs = RobotStreamer(self.log)
|
||||
|
||||
# We're ready to go!
|
||||
self.log.success('Ready to robot!')
|
||||
|
||||
def run(self):
|
||||
self.rs.run()
|
||||
|
||||
# Junk~
|
||||
while True:
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue