mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
34 lines
797 B
Python
34 lines
797 B
Python
|
#!/usr/bin/env python3
|
||
|
# -*-coding:UTF-8 -*
|
||
|
|
||
|
import os
|
||
|
import json
|
||
|
import sys
|
||
|
import logging
|
||
|
|
||
|
sys.path.append(os.environ['AIL_BIN'])
|
||
|
##################################
|
||
|
# Import Project packages
|
||
|
##################################
|
||
|
from lib.ConfigLoader import ConfigLoader
|
||
|
|
||
|
config_loader = ConfigLoader()
|
||
|
r_db = config_loader.get_db_conn("Kvrocks_DB")
|
||
|
config_loader = None
|
||
|
|
||
|
LOGGING_CONFIG = os.path.join(os.environ['AIL_HOME'], 'configs', 'logging.json')
|
||
|
|
||
|
def get_config(name=None):
|
||
|
if not name:
|
||
|
name = 'ail_warning.log'
|
||
|
else:
|
||
|
name = f'{name}.log'
|
||
|
with open(LOGGING_CONFIG, 'r') as f:
|
||
|
config = json.load(f)
|
||
|
config['handlers']['file']['filename'] = os.path.join(os.environ['AIL_HOME'], 'logs', name)
|
||
|
return config
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
pass
|