Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's more environments than just dev and prod. Even if the environments differ having some extra telemetry in a test environment often makes sense. So a @telemetry or @production decorator that does something in a non-production environment is an easy way to add that capability to functions.

I've found I like a decorator better than some envar testing custom logging/telemetry. If I have a custom_log function I use everywhere, I have to use it everywhere I might want it. With a decorator I can add it to only a few functions and get far less noise.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: