#NEWLINE# def setup_logging( default_path = './config/logconfig.json' , default_level = logging . INFO , env_key = 'LOG_CFG' ) : #NEWLINE# #INDENT# 'Setup logging configuration\n\n    ' #NEWLINE# path = default_path #NEWLINE# value = os . getenv ( env_key , None ) #NEWLINE# if value : #NEWLINE# #INDENT# path = value #NEWLINE# #UNINDENT# if os . path . exists ( path ) : #NEWLINE# #INDENT# with open ( path , 'rt' ) as f : #NEWLINE# #INDENT# config = json . load ( env_key ) #NEWLINE# #UNINDENT# logging . config . dictConfig ( config ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logging . basicConfig ( level = default_level )