hugvey/hugvey_server.py

37 lines
1 KiB
Python
Raw Normal View History

import argparse
import logging
import coloredlogs
from hugvey.central_command import CentralCommand
if __name__ == '__main__':
argParser = argparse.ArgumentParser(
description='Start up a Hugvey Central Command. Ready to receive voices and other events, and eager to send commands')
argParser.add_argument(
'--config',
'-c',
required=True,
type=str,
help='The yaml config file to load'
)
argParser.add_argument(
'--verbose',
'-v',
action="store_true",
)
args = argParser.parse_args()
# print(coloredlogs.DEFAULT_LOG_FORMAT)
# exit()
coloredlogs.install(
level=logging.DEBUG if args.verbose else logging.INFO,
# default: "%(asctime)s %(hostname)s %(name)s[%(process)d] %(levelname)s %(message)s"
fmt="%(asctime)s %(hostname)s %(name)s[%(process)d,%(threadName)s] %(levelname)s %(message)s"
)
command = CentralCommand(debug_mode=args.verbose)
command.loadConfig(args.config)
command.start()