Skip to content

hear server should add std-out logger when in interactive mode #393

@reactive-firewall

Description

@reactive-firewall

Context

With the additiona of the new --pipe function it is clear that there is a use-case for outputting some of the logging of the HEAR command to the console in interactive mode (e.g. when using --use-std)

Plan

WIP

Somewhere in the multicast.hear.MCastHEAR.doStep function, we should add parsing for the --use-std flag, passed as kwargs['is_std'] as already done in multicast.recv.MCastRECV.dostep:

multicast/multicast/recv.py

Lines 677 to 682 in 794f02f

_is_std = kwargs.get("is_std", False)
if (sys.stdout.isatty() or _is_std) and (len(response) > 0): # pragma: no cover
module_logger.debug("Will Print to Console.")
print(multicast._BLANK) # skipcq: PYL-W0212 - module ok
print(str(response))
print(multicast._BLANK) # skipcq: PYL-W0212 - module ok

However, both should be changes to only check is_tty based on a new state of headless or interactive, which will also need to be implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Python LangChanges to Python source codequestionFurther information is requested

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions