amoffat / sh

Python process launching

Home Page:https://sh.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No logs when using _fg=True

Exidex opened this issue · comments

With this code:

import logging
import sh

logging.basicConfig(level=logging.INFO)
sh.ls(_fg=True)

there is no logs printed from library to show what command was actually executed

Thanks for reporting.

I'm inclined to think that we shouldn't try to fix this. The docs for _fg already has a warning about sidestepping standard functionality. The reason that running in the foreground does not produce normal log output is that it completely bypasses the RunningCommand class where this log output is created.

Good call @ecederstrand, closing.