Loading project.clj +1 −1 Original line number Diff line number Diff line (defproject python/lein-template "0.19.0" (defproject python/lein-template "0.19.1" :description "lein template for a python project" :repositories [["snapshots" {:url "http://devserv.game.yy.com/nexus/content/repositories/snapshots" Loading src/leiningen/new/python/configlogger.py +3 −16 Original line number Diff line number Diff line Loading @@ -28,26 +28,13 @@ def load_logger_config(): fileConfig(resource_filename("{{name}}", "logger.conf")) return try: os.makedirs(logdir) fileConfig(resource_filename("{{name}}", "logger.conf")) return except OSError as _: pass import subprocess exit_code = subprocess.call(["sudo", "mkdir", "-p", logdir]) if exit_code == 0: fileConfig(resource_filename("{{name}}", "logger.conf")) return TESTING = os.getenv("PYTEST") == "1" level = logging.DEBUG if TESTING else logging.INFO ENV = os.getenv("ENV", "test") level = logging.INFO if ENV == "prod" else logging.DEBUG logging.basicConfig( format='%(asctime)s [%(module)s] %(levelname)-8s %(message)s', level=level) logging.info("Create log dir %s failed. Using basic config, level=%s", logdir, "DEBUG" if TESTING else "INFO") logdir, level) logging.captureWarnings(True) Loading Loading
project.clj +1 −1 Original line number Diff line number Diff line (defproject python/lein-template "0.19.0" (defproject python/lein-template "0.19.1" :description "lein template for a python project" :repositories [["snapshots" {:url "http://devserv.game.yy.com/nexus/content/repositories/snapshots" Loading
src/leiningen/new/python/configlogger.py +3 −16 Original line number Diff line number Diff line Loading @@ -28,26 +28,13 @@ def load_logger_config(): fileConfig(resource_filename("{{name}}", "logger.conf")) return try: os.makedirs(logdir) fileConfig(resource_filename("{{name}}", "logger.conf")) return except OSError as _: pass import subprocess exit_code = subprocess.call(["sudo", "mkdir", "-p", logdir]) if exit_code == 0: fileConfig(resource_filename("{{name}}", "logger.conf")) return TESTING = os.getenv("PYTEST") == "1" level = logging.DEBUG if TESTING else logging.INFO ENV = os.getenv("ENV", "test") level = logging.INFO if ENV == "prod" else logging.DEBUG logging.basicConfig( format='%(asctime)s [%(module)s] %(levelname)-8s %(message)s', level=level) logging.info("Create log dir %s failed. Using basic config, level=%s", logdir, "DEBUG" if TESTING else "INFO") logdir, level) logging.captureWarnings(True) Loading