mirror of
https://github.com/kittywitch/konawall-py.git
synced 2026-02-09 04:19:19 -08:00
14 lines
No EOL
461 B
Python
14 lines
No EOL
461 B
Python
import logging
|
|
import termcolor
|
|
|
|
"""
|
|
Print a key-value pair with a key and value coloured differently.
|
|
|
|
:param key: The key to print
|
|
:param value: The value to print
|
|
:param newline: Whether to print a newline after the value
|
|
:returns: None
|
|
"""
|
|
def kv_print(key: str, value: str, newline: bool = False) -> None:
|
|
logging.info(f"{key}: {value}")
|
|
print(termcolor.colored(key, "cyan") + ": " + termcolor.colored(value, "white"), end="\n" if newline else " ") |