I would love if multiple sinks could be used, and not just the one. For me, I'd like to be able to print to stdout/stderr as is the default, while also sending the messages to a custom sink.
I would image it would be easiest to allow logger.start to accept a list that would be called in order.
You can add as many sinks as you want.
Actually, logger.start(sink) does not start the logger, it starts the sink.
I realize now this is a bit confusing. I should have named the function logger.add() probably?
So, if you do logger.start(custom_sink) and then logger.start(another_sink), every log will be send to both of your sinks.
Yeah, that's a bit confusing. I would think logger.sink would be most descriptive.
Yep, I think the start method is a bit confusing, too. Maybe logger.add_sink would be a more descriptive alternative?
Yeah, that's a bit confusing. I would think
logger.sinkwould be most descriptive.
@volfco That would collide with the sink argument itself.
Yep, I think the
startmethod is a bit confusing, too. Maybelogger.add_sinkwould be a more descriptive alternative?
@samuelhwilliams Thanks for confirming that the method name is confusing, I will change it as soon as possible then!
I prefer not to repeat "sink" in method name, it should be a simple verb.
Once you know Loguru, you know that .add() is for adding a sink, there is little point to affix "sink" again. The issue is when you discover Loguru, you see logger.start() and may be confusing by thinking that this has to do with starting the logger, while it's about the sink.
So I could go with replacing start() / stop() by add() / remove() maybe.
I released a new version 0.2.2 which deprecate start() and stop() in favor of add() and remove().
I hope this will be less confusing. Thanks for having reporting this. 馃槈
Most helpful comment
@volfco That would collide with the
sinkargument itself.@samuelhwilliams Thanks for confirming that the method name is confusing, I will change it as soon as possible then!
I prefer not to repeat "sink" in method name, it should be a simple verb.
Once you know Loguru, you know that
.add()is for adding a sink, there is little point to affix "sink" again. The issue is when you discover Loguru, you seelogger.start()and may be confusing by thinking that this has to do with starting the logger, while it's about the sink.So I could go with replacing
start()/stop()byadd()/remove()maybe.