Clean up some LoggingContext stuff (#7120)
* Pull Sentinel out of LoggingContext ... and drop a few unnecessary references to it * Factor out LoggingContext.current_context move `current_context` and `set_context` out to top-level functions. Mostly this means that I can more easily trace what's actually referring to LoggingContext, but I think it's generally neater. * move copy-to-parent into `stop` this really just makes `start` and `stop` more symetric. It also means that it behaves correctly if you manually `set_log_context` rather than using the context manager. * Replace `LoggingContext.alive` with `finished` Turn `alive` into `finished` and make it a bit better defined.
Showing
- changelog.d/7120.misc 1 addition, 0 deletionschangelog.d/7120.misc
- docs/log_contexts.md 2 additions, 3 deletionsdocs/log_contexts.md
- synapse/crypto/keyring.py 2 additions, 2 deletionssynapse/crypto/keyring.py
- synapse/federation/federation_base.py 2 additions, 2 deletionssynapse/federation/federation_base.py
- synapse/handlers/sync.py 2 additions, 2 deletionssynapse/handlers/sync.py
- synapse/http/request_metrics.py 3 additions, 3 deletionssynapse/http/request_metrics.py
- synapse/logging/_structured.py 2 additions, 2 deletionssynapse/logging/_structured.py
- synapse/logging/context.py 118 additions, 116 deletionssynapse/logging/context.py
- synapse/logging/scopecontextmanager.py 5 additions, 8 deletionssynapse/logging/scopecontextmanager.py
- synapse/storage/data_stores/main/events_worker.py 2 additions, 2 deletionssynapse/storage/data_stores/main/events_worker.py
- synapse/storage/database.py 5 additions, 6 deletionssynapse/storage/database.py
- synapse/util/metrics.py 2 additions, 2 deletionssynapse/util/metrics.py
- synapse/util/patch_inline_callbacks.py 18 additions, 18 deletionssynapse/util/patch_inline_callbacks.py
- tests/crypto/test_keyring.py 3 additions, 4 deletionstests/crypto/test_keyring.py
- tests/http/federation/test_matrix_federation_agent.py 3 additions, 3 deletionstests/http/federation/test_matrix_federation_agent.py
- tests/http/federation/test_srv_resolver.py 3 additions, 3 deletionstests/http/federation/test_srv_resolver.py
- tests/http/test_fedclient.py 3 additions, 3 deletionstests/http/test_fedclient.py
- tests/rest/client/test_transactions.py 8 additions, 8 deletionstests/rest/client/test_transactions.py
- tests/unittest.py 8 additions, 4 deletionstests/unittest.py
- tests/util/caches/test_descriptors.py 12 additions, 10 deletionstests/util/caches/test_descriptors.py
Loading
Please register or sign in to comment