mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 18:21:12 +03:00
AC-575 Changed to show elapsed time instead of full timestamp.
This commit is contained in:
parent
d410f57e08
commit
165f983f86
@ -418,7 +418,11 @@ class Command(NoArgsCommand):
|
|||||||
self.logger = logging.getLogger('awx.main.commands.inventory_import')
|
self.logger = logging.getLogger('awx.main.commands.inventory_import')
|
||||||
self.logger.setLevel(log_levels.get(self.verbosity, 0))
|
self.logger.setLevel(log_levels.get(self.verbosity, 0))
|
||||||
handler = logging.StreamHandler()
|
handler = logging.StreamHandler()
|
||||||
formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s')
|
class Formatter(logging.Formatter):
|
||||||
|
def format(self, record):
|
||||||
|
record.relativeSeconds = record.relativeCreated / 1000.0
|
||||||
|
return super(Formatter, self).format(record)
|
||||||
|
formatter = Formatter('%(relativeSeconds)9.3f %(levelname)-8s %(message)s')
|
||||||
handler.setFormatter(formatter)
|
handler.setFormatter(formatter)
|
||||||
self.logger.addHandler(handler)
|
self.logger.addHandler(handler)
|
||||||
self.logger.propagate = False
|
self.logger.propagate = False
|
||||||
|
Loading…
Reference in New Issue
Block a user