Skip to content

Commit 008507b

Browse files
committed
adding a style switch to the log
1 parent 8542708 commit 008507b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tmuxp/cli.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ def get_cwd():
4242
return os.getcwd()
4343

4444

45-
def tmuxp_echo(message=None, log_level='INFO', **click_kwargs):
45+
def tmuxp_echo(message=None, log_level='INFO', style_log=False, **click_kwargs):
4646
"""
4747
Combines logging.log and click.echo
4848
"""
49-
logger.log(log.LOG_LEVELS[log_level], click.unstyle(message))
49+
if style_log:
50+
logger.log(log.LOG_LEVELS[log_level], message)
51+
else:
52+
logger.log(log.LOG_LEVELS[log_level], click.unstyle(message))
53+
5054
click.echo(message, **click_kwargs)
5155

5256

0 commit comments

Comments
 (0)