@@ -0,0 +1,1278 @@
+import logging.config%0Aimport yaml%0Aimport os%0A%0Adef setup_logging(config_path=None, log_level=logging.INFO):%0A    %22%22%22Setup logging configuration%0A    %22%22%22%0A%0A    config = %7B%0A        'version': 1,%0A        'disable_existing_loggers': False,%0A        'formatters': %7B%0A            'standard': %7B%0A                'format':%0A                    '%25(asctime)s - %25(name)s - %25(levelname)s - %25(message)s'%0A            %7D,%0A        %7D,%0A        'handlers': %7B%0A            'console': %7B%0A                'class': 'logging.StreamHandler',%0A                'level': log_level,%0A                'formatter': 'standard',%0A                'stream': 'ext://sys.stdout'%0A            %7D,%0A        %7D,%0A        'loggers': %7B%0A            '': %7B%0A                'handlers': %5B'console'%5D,%0A                'level': log_level,%0A                'propagate': True%0A            %7D,%0A            'yapsy': %7B%0A                'handlers': %5B'console'%5D,%0A                'level': logging.INFO%0A            %7D%0A        %7D%0A    %7D%0A%0A    if config_path:%0A        if os.path.exists(config_path):%0A            with open(config_path, 'rt') as f:%0A                config = yaml.safe_load(f.read())%0A        else:%0A            print('Specified path does not exist: %7B%7D, '%0A                  'using default config'.format(config_path))%0A%0A    logging.config.dictConfig(config)%0A

move logging into it's own module