MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / add_logging

Function add_logging

src/10/monkeypatching_modules_on_import/example2.py:14–16  ·  view source on GitHub ↗
(mod)

Source from the content-addressed store, hash-verified

12# Example
13@when_imported('math')
14def add_logging(mod):
15 mod.cos = logged(mod.cos)
16 mod.sin = logged(mod.sin)
17
18if __name__ == '__main__':
19 import math

Callers

nothing calls this directly

Calls 1

loggedFunction · 0.70

Tested by

no test coverage detected