hgitaly.logging: new module to log correlation_id
This provide san adapter to extract `correlation_id` from the gRPC context and add it to the logging `extra`, so that it may be used in a format, e.g.: `[%(asctime)s] [%(correlation_id)s] [%(levelname)s] [%(name)s] %(message)s` with the drawback that all loggers using this format will have to use the adapter. Minimal usage is added (`RequestLoggerInterceptor`) and support in `Service` fixture to get coverage with actual `ServicerContext` objects. Closes #122
parent
c5a8ff21
No related branches found
No related tags found
Showing
- hgitaly/interceptors.py 4 additions, 1 deletionhgitaly/interceptors.py
- hgitaly/logging.py 41 additions, 0 deletionshgitaly/logging.py
- hgitaly/service/tests/fixture.py 15 additions, 1 deletionhgitaly/service/tests/fixture.py
- hgitaly/service/tests/test_commit.py 4 additions, 2 deletionshgitaly/service/tests/test_commit.py
hgitaly/logging.py
0 → 100644
Please register or sign in to comment