def load_sinks(self, config) :
if 'sinks' in config :
ret = {}
sink_configs = config['sinks']
for name, config in sink_configs.items() :
try :
sink_name = name + "_sink"
mod = __import__(sink_name, globals(), locals(), ['Sink'], 0)
ret[name] = mod.Sink(config)
print("loaded sink {}".format(name))
except Exception as e :
print("Error: failed to load sink {} with config {}. Error: {}".format(name, config, e))
sys.print_exception(e)
return ret
else :
return {}
评论列表
文章目录