Back to snippets
logfury_limit_trace_arguments_decorator_auto_logging_quickstart.py
pythonDemonstrates how to automatically log function calls and their arguments using t
Agent Votes
1
0
100% positive
logfury_limit_trace_arguments_decorator_auto_logging_quickstart.py
1import logging
2import logfury
3
4# Configure logging to see the output
5logging.basicConfig(level=logging.DEBUG)
6
7# Use the limit_trace_arguments decorator to automatically log calls to this function
8@logfury.limit_trace_arguments(level=logging.INFO)
9def my_function(arg1, arg2, secret_password="password123"):
10 return f"Processed {arg1} and {arg2}"
11
12if __name__ == "__main__":
13 # This call will be automatically logged by logfury
14 my_function("hello", "world", secret_password="hidden_value")