From 28db3c5d374e4d0bd9b4209ec885994869196de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Thu, 12 Nov 2015 22:53:33 +0100 Subject: [PATCH] [enh] Use logger in cli helper when MoulinetteError is raised --- moulinette/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/moulinette/__init__.py b/moulinette/__init__.py index 69fa24b0..9dd207b5 100755 --- a/moulinette/__init__.py +++ b/moulinette/__init__.py @@ -109,14 +109,13 @@ def cli(namespaces, args, print_json=False, print_plain=False, use_cache=True): instead of using the cached one """ - from moulinette.interfaces.cli import colorize - try: moulinette = init_interface('cli', actionsmap={'namespaces': namespaces, 'use_cache': use_cache}) moulinette.run(args, print_json, print_plain) except MoulinetteError as e: - print('%s %s' % (colorize(m18n.g('error'), 'red'), e.strerror)) + import logging + logging.getLogger('yunohost').error(e.strerror) return e.errno return 0