| 792 | |
| 793 | # Logging Helpers |
| 794 | def stdout(*args, color: Optional[str]=None, prefix: str='', config: Optional[ConfigDict]=None) -> None: |
| 795 | ansi = DEFAULT_CLI_COLORS if (config or {}).get('USE_COLOR') else ANSI |
| 796 | |
| 797 | if color: |
| 798 | strs = [ansi[color], ' '.join(str(a) for a in args), ansi['reset'], '\n'] |
| 799 | else: |
| 800 | strs = [' '.join(str(a) for a in args), '\n'] |
| 801 | |
| 802 | sys.stdout.write(prefix + ''.join(strs)) |
| 803 | |
| 804 | def stderr(*args, color: Optional[str]=None, prefix: str='', config: Optional[ConfigDict]=None) -> None: |
| 805 | ansi = DEFAULT_CLI_COLORS if (config or {}).get('USE_COLOR') else ANSI |