mirror of
https://github.com/meineerde/rackstash.git
synced 2025-10-17 14:01:01 +00:00
The Sink was a vehicle to transport some shared state between the logger instance and the buffers, most notably the default fields and default tags. It turns out however, that error handling during merging of the default_fields and default_tags is non trivial since there, the buffer is in sime kind of limbo: users won't write to it anymore (and thus don't expect exceptions there) while the error handling of the individual flows is not yet reached. Since users can specify procs in default_fields, they can still raise for whatever user-defined reason. Luckily, the insertion of default fields and default tags can easily be done by a filter later anyway, under the protection of the flow's error handling in Flow#write. This allows us just remove the whole concept of the sink and just pass the Flows object to the Buffer. Not having to merge default_fields during event creation significantly simplifies Buffer#to_event which was rather ugly to begin with but now turned out quite beatifully.