Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  update requirements
  use configured logger on macrobase-driver
  add custom logging logging
  • Loading branch information
ShagaleevAlexey committed Feb 5, 2021
2 parents fef8b1f + ed8da9e commit cb7b967
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions aiopika_macrobase/endpoint.py
Expand Up @@ -7,6 +7,7 @@
from aio_pika import IncomingMessage

from structlog import get_logger
from macrobase_driver.logging import set_request_id
log = get_logger('macrobase.aiopika.endpoint')


Expand All @@ -30,6 +31,7 @@ async def handle(self, driver, message: IncomingMessage, data, *args, **kwargs)
AiopikaResult: Aiopika result action or None (if return None then driver ack message).
"""
try:
set_request_id(message.headers.get('x-cross-request-id'))
result = await self.method(driver, message, data, *args, **kwargs)
except Exception as e:
capture_exception(e)
Expand Down
2 changes: 2 additions & 0 deletions aiopika_macrobase/rpc/client.py
Expand Up @@ -16,6 +16,7 @@
from aio_pika.message import DeliveredMessage

from logging import getLogger
from macrobase_driver.logging import get_request_id
log = getLogger('AiopikaClient')


Expand Down Expand Up @@ -240,6 +241,7 @@ async def _get_message(self, body, content_type: str, type: str, correlation_id:
headers={
'lang': 'py',
'method': identifier,
'x-cross-request-id': get_request_id(),
# 'id': correlation_id,
# 'shadow': shadow,
# 'countdown': countdown,
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -2,7 +2,7 @@

setup(
name='aiopika_macrobase',
version='2.3.2',
version='2.4.0',
packages=find_packages(),
url='https://github.com/mbcores/aiopika-macrobase',
license='MIT',
Expand All @@ -14,7 +14,7 @@
'aio-pika==5.5.3',
'uvloop==0.14.0',
'python-rapidjson==0.8.0',
'structlog==19.2.0',
'structlog>=19.2.0,<21.0.0',
'sentry-sdk>=0.14.3',
'aiocontextvars==0.2.2'
]
Expand Down

0 comments on commit cb7b967

Please sign in to comment.