python-fire
python-fire copied to clipboard
Logging messages don't using logging
https://github.com/google/python-fire/blob/c1266d0dbb2114514fcf8be62044344b5a51c733/fire/core.py#L239 https://github.com/google/python-fire/blob/c1266d0dbb2114514fcf8be62044344b5a51c733/fire/core.py#L287
When I get the help message, includes INFO: messages like: INFO: Showing help with the command {cmd}
I would like such logging messages to use Python's logging framework which would allow me to suppress and redirect such messages.
Until this is fixed, you could use the following dirty hack to suppress these:
def _print(*args, **kwargs):
args = [arg for arg in args
if not isinstance(arg, str) or not arg.startswith('INFO: Showing help')]
if not args:
return
print(*args, **kwargs)
fire.core.print = _print
is this issue up for grabs? I would love to work on it.
We'd like to fix this such that for the typical user (who doesn't configure any logging settings), the behavior is the same as it currently is, with the INFO logs being displayed appropriately.
@dravog7 Yes, this issue is not currently being worked on and you are welcome to work on it if you are still interested in doing so.
I will work on this