Created
September 17, 2019 18:24
-
-
Save TimothyLoyer/45bfbc1a7b37dd5961ad016be6b5fc3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wrap_log_output(message: str, line_char: str = "#", log: logger = logger.info): | |
if not isatty(sys.stdin.fileno()): | |
log(message) | |
else: | |
_, columns = subprocess.check_output(["stty", "size"]).split() | |
def hr(): | |
print(line_char * int(columns)) | |
hr() | |
log(message) | |
hr() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment