Since this thing is on the innerwebs I suppose it should have a
[python_utils.git] / id_generator.py
index bcd3a833270ffcd8f69f9c53f5a036d2c711566e..f15efa360e46a07e59d21fe4b85e950f4fcf05a0 100644 (file)
@@ -1,5 +1,12 @@
 #!/usr/bin/env python3
 
+# © Copyright 2021-2022, Scott Gasch
+
+"""A helper class for generating thread safe monotonically increasing
+id numbers.
+
+"""
+
 import itertools
 import logging
 
@@ -28,10 +35,11 @@ def get(name: str, *, start=0) -> int:
     if name not in generators:
         generators[name] = itertools.count(start, 1)
     x = next(generators[name])
-    logger.debug(f"Generated next id {x}")
+    logger.debug("Generated next id %d", x)
     return x
 
 
 if __name__ == '__main__':
     import doctest
+
     doctest.testmod()