def setup_logging(<EOL>config='<STR_LIT>',<EOL>default_level=logging.INFO,<EOL>env_key='<STR_LIT>'<EOL>):
path = config<EOL>value = os.getenv(env_key, None)<EOL>if value:<EOL><INDENT>path = value<EOL><DEDENT>if path.exists():<EOL><INDENT>with open(path, '<STR_LIT>') as f:<EOL><INDENT>config = yaml.safe_load(f.read())<EOL><DEDENT>logging.config.dictConfig(config)<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>' + str(path))<EOL>logging.basicConfig(level=default_level)<EOL><DEDENT>
Setup logging configuration