-
Hi all, I'm trying to set the @timed decorator to only display for my debug env and not the production env. This is my attempt so far: ` timed_logger = logging.getLogger(name) @timed(**timed_kwargs) What I would expect to see with the above code: If I run from the IDE, then it would log the time as per usual when simply using @timed decorator. Then if I run from a prod link, it would not show anything for the timing of calling my_func() It's not printing the time for either debug or prod environments. Any suggestions where I'm going wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If you want something simple then just use an anvil extras logger instead of Python's logging. If you want to use pythons logger you'll need to follow the docs to send the stream to stdout. You should be able to find examples online of how to do this. |
Beta Was this translation helpful? Give feedback.
If you want something simple then just use an anvil extras logger instead of Python's logging.
If you want to use pythons logger you'll need to follow the docs to send the stream to stdout. You should be able to find examples online of how to do this.