Include docstring
@@ -5,6 +5,14 @@ import click
class ColourizedFormatter(logging.Formatter):
+ """
+ A custom log formatter class that:
+
+ * Outputs the LOG_LEVEL with an appropriate color.
+ * If a log call includes an `extras={"color_message": ...}` it will be used
+ for formatting the output, instead of the plain text message.
+ """
+
level_name_colors = {
logging.DEBUG: lambda level_name: click.style(str(level_name), fg="blue"),
logging.INFO: lambda level_name: click.style(str(level_name), fg="green"),
