# -*- coding: UTF-8 -*-
from dcs.tests.server import Server
from configparser import ConfigParser
from loguru import logger


logger.add('./dcs.log', rotation='10 MB', enqueue=True, backtrace=True, diagnose=True)
logger.info('reading config args...')
configFile = '../conf/settings.ini'
con = ConfigParser()
con.read(configFile, encoding='utf-8')
items = con.items('server')
items = dict(items)

logger.info('starting the server...')
server = Server(int(items['port']))
server.daemon = items['daemon']
server.start()
server.join()

logger.warning('Overing...')
