Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DebugMiddleware feature #191

Closed
danylott opened this issue Jul 26, 2021 · 0 comments · May be fixed by #193
Closed

DebugMiddleware feature #191

danylott opened this issue Jul 26, 2021 · 0 comments · May be fixed by #193
Assignees

Comments

@danylott
Copy link
Contributor

Add DebugMiddleware, which will print all nats activity of microservice.
Template of DebugMiddleware:

class DebugMiddleware(Middleware):
    def __init__(self, logger):
        self.logger = logger

    async def send_any(self, subject: str, message, send_func, *args, **kwargs):
        self.logger.info(f"Sent to {subject} message {message}")
        return await send_func(subject, message, *args, **kwargs)

It Will be cool to have a chance to select log level, also add listen_any function, and to choose, which (listen or send or both) to debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants