I've considered something like this in the past...
When I was first designing lumberjack, and researching other logging frameworks, I noticed things like separation of filters and formatters and chained formatters, etc. Ultimately I decided to "keep it simple". A formatter is a filter is a formatter. I felt that keeping the architecture conceptually simple (at least at this level) would pay off. My intent is that complexity can be added within the formatter itself. For example, one could craft a "formatter container" which accepts a list of independent formatters, and applies them serially. This allows for advanced techniques such as chaining, headers/footers, etc.
I hope this helps. Let me know your thoughts.
--
Robbie Hanson
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
Le mercredi 15 août 2012 à 14:19, mkloster a écrit :
> Can formatters be chained? That is, can a logger have multiple formatters applied to it? It appears calling [logger setFormatter] replaces the previous formatter.
> Use case could be to use a formatter which applies a logging format, and another which functions as a whitelist filter.
> thanks,
> Michael
> --
> You received this message because you are subscribed to the Google Groups "CocoaLumberjack" group.
> To post to this group, send email to cocoalumberjack@googlegroups.com.
> To unsubscribe from this group, send email to cocoalumberjack+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msg/cocoalumberjack/-/FMM4gV_HeX4J.
> For more options, visit https://groups.google.com/groups/opt_out.