thephpleague / tactician-logger

Adds PSR-3 logging support to the Tactician Command Bus
62 stars 8 forks source link

Adding a CommandNameFormatter #10

Open amazium opened 5 years ago

amazium commented 5 years ago

Currently there is a ClassNameFormatter. This is useful when the ClassName is the command name, but if our CommandHandlerMiddleware uses a different CommandNameExtractor it isn't.

I propose adding an extra formatter CommandNameFormatter that accepts a CommandNameExtractor as a parameter. Other logic similar to the ClassNameFormatter.

rosstuck commented 5 years ago

Can do, though would it be easier to create a custom implementation of the Formatter interface for your specific project? For Tactician2 (if I ever get time), I'm likely going to drop the ClassNameFormatter concept entirely and default to just get_class across the board, since I think FQCNs have become the de facto implementation for most projects?