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 install -r requirements.txt
|
||||||
|
|
||||||
pipenv run python -m houston
|
pipenv run python -m houston -v
|
||||||
|
|
|
@ -3,12 +3,28 @@
|
||||||
# Kitsune Scientific
|
# Kitsune Scientific
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import argparse
|
||||||
import verboselogs
|
import verboselogs
|
||||||
import coloredlogs
|
import coloredlogs
|
||||||
|
|
||||||
from houston.houston import Houston
|
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
|
# Install verbose logs
|
||||||
verboselogs.install()
|
verboselogs.install()
|
||||||
|
|
||||||
|
@ -16,7 +32,7 @@ verboselogs.install()
|
||||||
logger = logging.getLogger('Houston_Log')
|
logger = logging.getLogger('Houston_Log')
|
||||||
|
|
||||||
# Install colored logs
|
# Install colored logs
|
||||||
coloredlogs.install(level='INFO',
|
coloredlogs.install(level=args.loglevel,
|
||||||
logger=logger,
|
logger=logger,
|
||||||
fmt='%(asctime)s,%(msecs)03d %(hostname)s %(levelname)s %(message)s') # noqa: E501
|
fmt='%(asctime)s,%(msecs)03d %(hostname)s %(levelname)s %(message)s') # noqa: E501
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import houston.robotstreamer.streamer
|
from houston.robotstreamer.streamer import RobotStreamer
|
||||||
|
|
||||||
|
|
||||||
class Houston:
|
class Houston:
|
||||||
|
@ -12,10 +12,15 @@ class Houston:
|
||||||
# Setup logger
|
# Setup logger
|
||||||
self.log = logger
|
self.log = logger
|
||||||
|
|
||||||
|
# Setup robotstreamer
|
||||||
|
self.rs = RobotStreamer(self.log)
|
||||||
|
|
||||||
# We're ready to go!
|
# We're ready to go!
|
||||||
self.log.success('Ready to robot!')
|
self.log.success('Ready to robot!')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
self.rs.run()
|
||||||
|
|
||||||
# Junk~
|
# Junk~
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue