Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: optimize verbosity logging output #963

Open
steadfasterX opened this issue Sep 9, 2022 · 0 comments
Open

ansible: optimize verbosity logging output #963

steadfasterX opened this issue Sep 9, 2022 · 0 comments
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome

Comments

@steadfasterX
Copy link

This is related to: #172
mitogen version: v0.3.3

Unfortunately using -vvv (aka verbosity=3) in ansible is not as verbose as logging.DEBUG in mitogen.
in Ansible's verbosity level 3 you get ofc more output but it is still readable - which is not the case for logging.DEBUG in mitogen (imho).

I currently use this instead of: https://github.com/mitogen-hq/mitogen/blob/v0.3.3/ansible_mitogen/logging.py#L118-L130

    if display.verbosity == 2:
        l_ansible_mitogen.setLevel(logging.DEBUG)
        l_mitogen.setLevel(logging.WARNING)
    elif display.verbosity == 3:
        l_ansible_mitogen.setLevel(logging.DEBUG)
        l_mitogen.setLevel(logging.DEBUG)
    elif display.verbosity >= 4:
        l_mitogen_io.setLevel(logging.DEBUG)
        l_ansible_mitogen.setLevel(logging.DEBUG)
    else:
        # Mitogen copies the active log level into new children, allowing them
        # to filter tiny messages before they hit the network, and therefore
        # before they wake the IO loop. Explicitly setting INFO saves ~4%
        # running against just the local machine.
        l_mitogen.setLevel(logging.ERROR)
        l_ansible_mitogen.setLevel(logging.ERROR)

the above:

  • sets explicit levels on each verbosity level
  • sets the logging level of mitogen to WARNING when -vv is used (instead of DEBUG)

dunno if that fits for others but thats how it works for me.

@steadfasterX steadfasterX added affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome labels Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-0.3 Issues related to 0.3.X Mitogen releases bug Code feature that hinders desired execution outcome
Projects
None yet
Development

No branches or pull requests

1 participant