Skip to content

Commit 50cfcd8

Browse files
authored
logging: fix early logging (#49)
Enable logging through logger objects early in the instantiation of collectors. Without explicitly calling `logging.basicConfig()`, any calls to `logging.getLogger(...).info(...)` and `...debug(...)` produce no output until `logging.log(...)` or friends were called once.
1 parent fb5a956 commit 50cfcd8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

p3exporter/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def main():
2929
signal.signal(signal.SIGTERM, signal_handler)
3030
signal.signal(signal.SIGINT, signal_handler)
3131

32+
logging.basicConfig()
3233
logging.getLogger().setLevel(logging.INFO)
3334

3435
parser = argparse.ArgumentParser(description="Python programmable Prometheus exporter.")

0 commit comments

Comments
 (0)