invenia / Memento.jl

A flexible logging library for Julia
https://invenia.github.io/Memento.jl/latest
Other
88 stars 14 forks source link

Proposal: Remove IO as a parameter to Handler #89

Closed iamed2 closed 4 years ago

iamed2 commented 6 years ago

Not all Handlers can necessarily write to any IO. Most require writing a log at a time, with some specific API call, which is not how the IO interface works (it takes bytes). I think it's good to keep IO as a parameter to DefaultHandler. Maybe even introduce an IOHandler abstract type into the hierarchy if there's a strong possibility of another handler using IO.

Note: I'm solving the issue right now with this hacky trick:

struct MyHandler{F<:Formatter} <: Handler{F, Union{}}