{"id":6711,"library":"logfury","title":"logfury","description":"Logfury is a toolkit for Python library maintainers, offering responsible, low-boilerplate logging of method calls. It implements an 'apiver' import strategy (e.g., `from logfury.v1 import ...`) to ensure API stability, allowing users to explicitly opt into versioned APIs. The library is currently at version 1.0.1, released on October 23, 2021, with a focus on method call tracing and a mature development status.","status":"active","version":"1.0.1","language":"en","source_language":"en","source_url":"https://github.com/reef-technologies/logfury","tags":["logging","decorator","observability","library-development"],"install":[{"cmd":"pip install logfury","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"Logfury uses an 'apiver' strategy; always import from a specific version module (e.g., `v1`) to ensure API stability and avoid breaking changes from a top-level import.","wrong":"from logfury import DefaultTraceMeta","symbol":"DefaultTraceMeta","correct":"from logfury.v1 import DefaultTraceMeta"},{"note":"Part of the versioned API.","symbol":"limit_trace_arguments","correct":"from logfury.v1 import limit_trace_arguments"},{"note":"Part of the versioned API.","symbol":"disable_trace","correct":"from logfury.v1 import disable_trace"}],"quickstart":{"code":"import logging\nimport six\nfrom logfury.v1 import DefaultTraceMeta, limit_trace_arguments, disable_trace\n\nlogging.basicConfig()\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.DEBUG)\n\n@six.add_metaclass(DefaultTraceMeta)\nclass Foo:\n    def baz(self, a, b, c=None):\n        return True\n\n    def get_blah(self):\n        return 5\n\n    def _hello(self):\n        pass\n\n    @disable_trace\n    def world(self):\n        pass\n\n    def __repr__(self):\n        return '<{} object>'.format(self.__class__.__name__)\n\nclass Bar(Foo):\n    def baz(self, a, b, c=None):\n        b += 1\n        return super(Bar, self).baz(a, b, c)\n\n    @limit_trace_arguments(skip=['password'])\n    def secret(self, password, other):\n        pass\n\na = Foo()\na.baz(1, 2, 3)\na.baz(4, b=8)\na.get_blah() # Not traced by default pattern\na._hello()   # Not traced by default pattern\na.world()    # Explicitly disabled\n\nb = Bar()\nb.baz(5, 6)\nb.secret('my_secret', 'other_value')\n\n# Expected output in console for a.baz calls:\n# DEBUG:__main__:calling Foo.baz(self=<Foo object>, a=1, b=2, c=3)\n# DEBUG:__main__:calling Foo.baz(self=<Foo object>, a=4, b=8)\n","lang":"python","description":"This example demonstrates basic usage of `logfury` by applying `DefaultTraceMeta` to a class to automatically log method calls. It also shows `disable_trace` for excluding methods and `limit_trace_arguments` for sensitive parameters. Ensure basic logging is configured to see output."},"warnings":[{"fix":"Upgrade to Python 3.5 or a later supported version.","message":"Support for Python versions prior to 3.5 was deprecated in v1.0.0. Ensure your environment uses Python 3.5 or newer.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Always use `from logfury.v1 import ...` to explicitly bind to a stable API version.","message":"Logfury uses an 'apiver' strategy where you explicitly import from `logfury.vX` (e.g., `logfury.v1`). Importing directly from `logfury` (e.g., `from logfury import ...`) is not recommended as it could lead to unexpected behavior or breakage if the default top-level API changes in future versions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade to logfury version 1.0.1 or newer to ensure correct class decoration and argument ordering in logs.","message":"Prior to version 1.0.1, there were known issues with decorating entire classes and incorrect ordering of arguments in logged output. These were fixed in v1.0.1.","severity":"gotcha","affected_versions":"<1.0.1"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}