Compare commits

..

2 Commits

Author SHA1 Message Date
Kenwood e421634432 Stay up to date 2021-11-27 16:03:37 -05:00
Kenwood fba81ef345 Add ability to log remote 2021-11-27 16:03:20 -05:00
2 changed files with 15 additions and 5 deletions

View File

@ -6,7 +6,8 @@ import coloredlogs
verboselogs.install() verboselogs.install()
# Create a logger object. # Create a logger object.
logger = logging.getLogger(__name__) hlog = logging.getLogger('Houston_Log')
rlog = logging.getLogger('Robot_Log')
# By default the install() function installs a handler on the root logger, # By default the install() function installs a handler on the root logger,
# this means that log messages from your code and log messages from the # this means that log messages from your code and log messages from the
@ -17,15 +18,22 @@ logger = logging.getLogger(__name__)
# If you don't want to see log messages from libraries, you can pass a # If you don't want to see log messages from libraries, you can pass a
# specific logger object to the install() function. In this case only log # specific logger object to the install() function. In this case only log
# messages originating from that logger will show up on the terminal. # messages originating from that logger will show up on the terminal.
coloredlogs.install(level='INFO', logger=logger) coloredlogs.install(level='INFO',
logger=hlog,
fmt='%(asctime)s,%(msecs)03d %(hostname)s %(levelname)s %(message)s')
logger.info('Lewis Companion Software Started.') coloredlogs.install(level='INFO',
logger.success('Ready to robot!') logger=rlog,
fmt='%(asctime)s,%(msecs)03d Robot %(levelname)s %(message)s')
hlog.info('Lewis Companion Software Started.')
hlog.success('Ready to robot!')
rlog.info('Logging message from robot!')
# Junk~ # Junk~
while True: while True:
try: try:
logger.debug('Nothing to do.') hlog.debug('Nothing to do.')
time.sleep(1) time.sleep(1)
except KeyboardInterrupt: except KeyboardInterrupt:
break break

View File

@ -2,6 +2,8 @@
cd /opt/lewis-crawler/companion_software/dashboard cd /opt/lewis-crawler/companion_software/dashboard
git pull
pipenv install -r requirements.txt pipenv install -r requirements.txt
pipenv run python dash.py pipenv run python dash.py