Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

DebugMiddleware feature #191

@danylott

Description

@danylott

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions