def setColor(message, bold=False): retVal = message if message and getattr(LOGGER_HANDLER, "is_tty", False): # colorizing handler if bold: retVal = colored(message, color=None, on_color=None, attrs=("bold",)) return retVal