Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge multiple composable loggers (opposite of Demux) #19

Open
oxinabox opened this issue Oct 1, 2019 · 1 comment
Open

Merge multiple composable loggers (opposite of Demux) #19

oxinabox opened this issue Oct 1, 2019 · 1 comment

Comments

@oxinabox
Copy link
Member

oxinabox commented Oct 1, 2019

We can imaging Demuxing logs,
into many "streams" which go through a varitety of filters,
but then we might want to merge them back together for a final output, to a common sink.
So we need a MuxLogger

Better name needed.
Also better name needed for DemuxLogger

@oxinabox
Copy link
Member Author

Wait this is not needed.
Composable loggers take destinations,
not sources.

So to mux one just reuses the destination.

eg.

sink = ConsoleLogger(stderr, BelowMinLevel)
filter_a = EarlyFilteredLogger(sink) do log
    log._module==Main || log.level > Logging.Debug
end
filter_b = EarlyFilteredLogger(sink) do log
    log.level > Logging.Info
end

demux = Demux(filter_a, filter_b)

So this is a Documentation issue

@oxinabox oxinabox changed the title MuxLogger: Merge multiple composable loggers Merge multiple composable loggers (opposite of Demux) Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant