kafe
kafe copied to clipboard
Use hostname diffs for inventory naming in output
Currently log lines include context for the output that includes current task, active role, and full inventory name. This is problematic with long inventory names because it takes a lot of console real estate.
The solution here would be to replace a part of the inventory name with short placeholders where said hostnames overlap within the current (!!!) role target inventory.
Simplest solution that would cover most cases would probably be to discard the tail of the inventory name till first character difference in the name of the item, and then discard head of the inventory name till first character difference in the name. Replaced parts of the inventory names, if any, should be replaced with asterisks in output.
Exceptions to this:
- IPv4 and IPV6 addresses are used instead of hostname (IP should always use full output)
Example of current behavior:
[15:38:29] INFO [deploy] [example] [[email protected]] Changing remote working directory for current context to </tmp>
[15:38:29] INFO [deploy] [example] [[email protected]] Changing remote working directory for current context to </tmp>
[15:38:29] INFO [deploy] [example] [[email protected]] Changing remote working directory for current context to </tmp>
Example of new behavior:
[15:38:29] INFO [deploy] [example] [*e1.c1*] Changing remote working directory for current context to </tmp>
[15:38:29] INFO [deploy] [example] [*e2.c1*] Changing remote working directory for current context to </tmp>
[15:38:29] INFO [deploy] [example] [*e1.c2*] Changing remote working directory for current context to </tmp>