@@ -27,6 +27,18 @@ In addition to logging function calls, `funlog` decorators also time the functio
27
27
and can log arguments briefly but clearly, abbreviating arguments like long strings or
28
28
dataclasses.
29
29
30
+ I'm publishing it standalone since I have found over the years I frequently want to drop
31
+ it into projects. It's often even easier to use than quick print debugging.
32
+
33
+ In addition to logging calls, it lets you do very lightweight profiling by having
34
+ warnings in production when certain functions are take more than a specified amount of
35
+ time. Finally, you can use the decorators to get tallies of function calls and runtimes
36
+ per function after a program runs a while or at exit.
37
+
38
+ It deliberately has ** zero dependencies** and is a single file with ~ 500 lines of code.
39
+
40
+ ## Options
41
+
30
42
The decorator is simple with reasonable defaults but is also fully customizable with
31
43
optional arguments to the decorator.
32
44
You can control whether to show arg values and return values:
@@ -46,21 +58,11 @@ By default both calls and returns are logged, but this is also customizable:
46
58
If ` if_slower_than_sec ` is set, only log calls that take longer than that number of
47
59
seconds.
48
60
49
- By default, uses standard logging with the given ` level ` , but you can pass in a custom
50
- ` log_func ` to override that.
61
+ By default, it uses standard logging with the given ` level ` , but you can pass in a
62
+ custom ` log_func ` to override that.
51
63
52
- By default, it shows values using ` quote_if_needed() ` , which is brief and very readable.
53
- You can pass in a custom ` repr_func ` to change that.
54
-
55
- I'm publishing it standalone since I have found over the years I frequently want to drop
56
- it into projects. It's often even easier to use than quick print debugging.
57
-
58
- It also lets you do very lightweight profiling by having warnings in production when
59
- certain functions are taking a lot of time.
60
- Finally, is easy to get tallies of function calls and runtimes per function after a
61
- program runs a while or at exit.
62
-
63
- It deliberately has ** zero dependencies** and is a single file with ~ 500 lines of code.
64
+ Also by default, it shows values using ` quote_if_needed() ` , which is brief and very
65
+ readable. You can pass in a custom ` repr_func ` to change that.
64
66
65
67
## Installation
66
68
0 commit comments