Skip to content

Commit

Permalink
logging stream handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sholdee committed Jun 27, 2024
1 parent 98729dc commit 492122e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions adguard_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
logging.basicConfig(level=logging.INFO, format=log_format)
logger = logging.getLogger(__name__)

# Explicitly add a stream handler for stdout
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.INFO)
formatter = logging.Formatter(log_format)
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.propagate = False

# Configuration
config = configparser.ConfigParser()
config.read_dict({
Expand Down

0 comments on commit 492122e

Please sign in to comment.