diff options
Diffstat (limited to 'xnt')
-rw-r--r-- | xnt/tasks.py | 5 | ||||
-rw-r--r-- | xnt/xenant.py | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/xnt/tasks.py b/xnt/tasks.py index 02cde24..1981e9b 100644 --- a/xnt/tasks.py +++ b/xnt/tasks.py @@ -70,12 +70,13 @@ def mv(src, dst): def mkdir(directory, mode=0o777): """Make a directory with mode""" if os.path.exists(directory): + LOGGER.warning("Given directory (%s) already exists" % directory) return LOGGER.info("Making directory %s with mode %o", directory, mode) try: os.mkdir(directory, mode) except IOError as io_error: - log(io_error, logging.WARNING) + log(io_error, logging.ERROR) except: raise @@ -92,7 +93,7 @@ def rm(*fileset): else: os.remove(file_to_delete) except OSError as os_error: - log(os_error, logging.WARNING) + log(os_error, logging.ERROR) except: raise diff --git a/xnt/xenant.py b/xnt/xenant.py index 5e8dc66..f11f281 100644 --- a/xnt/xenant.py +++ b/xnt/xenant.py @@ -25,9 +25,10 @@ import argparse from xnt import __version__ from xnt.status_codes import SUCCESS, ERROR, UNKNOWN_ERROR -logging.basicConfig(format="%(asctime)s:%(levelname)s:%(message)s") +logging.basicConfig(format="%(message)s") LOGGER = logging.Logger(name=__name__) LOGGER.addHandler(logging.StreamHandler()) +LOGGER.setLevel(logging.WARNING) def main(): """Xnt Entry Point""" @@ -45,9 +46,9 @@ def main(): args["targets"], args["properties"]) elapsed_time = time.time() - start_time - LOGGER.info("Execution time: %.3f", elapsed_time) + print("Execution time: %.3f", elapsed_time) if error_code != 0: - LOGGER.info("Failure") + LOGGER.error("Failure") from xnt.tasks import rm rm("build.pyc", "__pycache__", |