summaryrefslogtreecommitdiff
path: root/xnt
diff options
context:
space:
mode:
authorkennyballou <kballou@onyx.boisestate.edu>2013-03-09 08:29:12 -0700
committerkennyballou <kballou@onyx.boisestate.edu>2013-03-10 20:56:57 -0600
commit69874f19c238d4ded308430902238f4e692cb335 (patch)
tree0bb8242ee6251f0c0dd8336624857c129c89f72f /xnt
parentaeb0672db3f2a4ddb4812344398831180a723d0c (diff)
downloadxnt-69874f19c238d4ded308430902238f4e692cb335.tar.gz
xnt-69874f19c238d4ded308430902238f4e692cb335.tar.xz
Adjust logging levels
Diffstat (limited to 'xnt')
-rw-r--r--xnt/tasks.py5
-rw-r--r--xnt/version.py2
-rw-r--r--xnt/xenant.py7
3 files changed, 8 insertions, 6 deletions
diff --git a/xnt/tasks.py b/xnt/tasks.py
index 7a3e79d..5140618 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/version.py b/xnt/version.py
index 3562358..7db0124 100644
--- a/xnt/version.py
+++ b/xnt/version.py
@@ -17,5 +17,5 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-__version_info__ = (0, 5, 2)
+__version_info__ = (0, 5, 2, "logging_refactor", "dev")
__version__ = '.'.join(list(str(i) for i in __version_info__ if True))
diff --git a/xnt/xenant.py b/xnt/xenant.py
index e67ef7c..10be9b9 100644
--- a/xnt/xenant.py
+++ b/xnt/xenant.py
@@ -25,9 +25,10 @@ from xnt.cmdoptions import OPTIONS
from xnt.commands import COMMANDS
from xnt.commands.target import TargetCommand
-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"""
@@ -57,9 +58,9 @@ def main():
command = TargetCommand(load_build())
error_code = command.run(targets=cmds, props=params)
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__")