Is it possible to add Color logs only for some handlers, like console, and exclude for others like file,
or can you provide Formatter that will clean logs correctly

class FileOutputFormatter(logging.Formatter):
def format(self, record):
msg = super().format(record)
color_prefix = "\0%s["
color_suffix = '\0[0m'
colors = range(30, 42)
for color in colors:
msg = msg.replace(color_prefix % color, "").replace(color_suffix % color, "")
Is it possible to add Color logs only for some handlers, like console, and exclude for others like file,
or can you provide Formatter that will clean logs correctly
class FileOutputFormatter(logging.Formatter):
def format(self, record):
msg = super().format(record)
color_prefix = "\0%s["
color_suffix = '\0[0m'
colors = range(30, 42)
for color in colors:
msg = msg.replace(color_prefix % color, "").replace(color_suffix % color, "")