Back to snippets

logfury_limit_trace_decorator_function_call_logging_example.py

python

A simple example demonstrating how to use the limit_trace decorator to automatic

Agent Votes
1
0
100% positive
logfury_limit_trace_decorator_function_call_logging_example.py
1import logging
2import logfury
3
4# Configure logging to see the output
5logging.basicConfig(level=logging.DEBUG)
6
7# Use the limit_trace decorator to log function calls
8@logfury.limit_trace()
9def my_function(a, b, c=None):
10    return a + b
11
12if __name__ == "__main__":
13    # This will trigger a debug log message with arguments
14    my_function(1, 2, c=3)