diff options
author | kennyballou <kballou@onyx.boisestate.edu> | 2012-10-16 15:56:58 -0600 |
---|---|---|
committer | kballou <kballou@onyx.boisestate.edu> | 2012-10-16 15:56:58 -0600 |
commit | d87cbfb0339a52be7931ca3bd730fbdcfae076e9 (patch) | |
tree | cb780a4f369b19bcf6a92e647f077093662ad3d1 /xnt/tasks.py | |
parent | c4dc1ebbafa52bd61d69d81b740bdd856b4a8faf (diff) | |
download | xnt-d87cbfb0339a52be7931ca3bd730fbdcfae076e9.tar.gz xnt-d87cbfb0339a52be7931ca3bd730fbdcfae076e9.tar.xz |
Add logging
Diffstat (limited to 'xnt/tasks.py')
-rw-r--r-- | xnt/tasks.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xnt/tasks.py b/xnt/tasks.py index ced5030..15db36a 100644 --- a/xnt/tasks.py +++ b/xnt/tasks.py @@ -7,18 +7,24 @@ import time import shutil import zipfile import contextlib +import logging + +logger = logging.getLogger("Xnt") #File associated tasks def cp(src,dst): + logger.info("Copying %s to %s", src, dst) if os.path.isdir(src): shutil.copytree(src,dst) else: shutil.copy2(src,dst) def mv(src,dst): + logger.info("Moving %s to %s", src, dst) shutil.move(src,dst) def mkdir(dir,mode=0o777): + logger.info("Making directory %s with %s mode", dir, mode) try: os.mkdir(dir,mode) except IOError: @@ -27,6 +33,7 @@ def mkdir(dir,mode=0o777): raise def rm(path): + logger.info("Removing %s", path) try: if os.path.isdir(path): shutil.rmtree(path) @@ -38,6 +45,7 @@ def rm(path): raise def zip(dir,zipfilename): + logger.info("Zipping %s as %s", dir, zipfilename) assert os.path.isdir(dir) and zipfilename with contextlib.closing(zipfile.ZipFile( zipfilename, |