mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Use given namespace in cli/api helpers for logging
This commit is contained in:
parent
87f171f25b
commit
cbc64af4a5
1 changed files with 3 additions and 3 deletions
|
@ -101,11 +101,11 @@ def api(namespaces, host='localhost', port=80, routes={},
|
||||||
moulinette.run(host, port)
|
moulinette.run(host, port)
|
||||||
except MoulinetteError as e:
|
except MoulinetteError as e:
|
||||||
import logging
|
import logging
|
||||||
logging.getLogger('moulinette').error(e.strerror)
|
logging.getLogger(namespaces[0]).error(e.strerror)
|
||||||
return e.errno
|
return e.errno
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
import logging
|
import logging
|
||||||
logging.getLogger('moulinette').info(m18n.g('operation_interrupted'))
|
logging.getLogger(namespaces[0]).info(m18n.g('operation_interrupted'))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def cli(namespaces, args, use_cache=True, output_as=None, parser_kwargs={}):
|
def cli(namespaces, args, use_cache=True, output_as=None, parser_kwargs={}):
|
||||||
|
@ -136,6 +136,6 @@ def cli(namespaces, args, use_cache=True, output_as=None, parser_kwargs={}):
|
||||||
moulinette.run(args, output_as=output_as)
|
moulinette.run(args, output_as=output_as)
|
||||||
except MoulinetteError as e:
|
except MoulinetteError as e:
|
||||||
import logging
|
import logging
|
||||||
logging.getLogger('moulinette').error(e.strerror)
|
logging.getLogger(namespaces[0]).error(e.strerror)
|
||||||
return e.errno
|
return e.errno
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in a new issue