{"version":"1.0","type":"rich","title":"Python dual-logging setup (console and log file) supporting different log levels and colorized output","description":"This example demonstrates a dual-logging setup for Python applications, sending console output and file logs to separate destinations with distinct severity levels and formatting. The code defines a `LogFormatter` class that applies ANSI color codes to console messages based on log level, while writing plain, uncolored records to the log file. It uses the standard `logging` module with `StreamHandler` for stdout and `FileHandler` for file output, configuring the root logger to handle debug through critical messages. A template controls the output format, including timestamps, thread names, and log levels.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-c094ef178481be8492e3774dd4ef9e91?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}