Open mivoligo opened 1 year ago
Unfortunately not. Currently, there is only a one-to-one relationship possible between a logger and it's printer.
OK, thanks for the very quick response :+1:
You're welcome! Do you want to keep this issue as a feature request, or should I close it?
I think keeping it as a feature request could be fine. Maybe someone else will have similar requirements.
It's pretty easy to write such class:
class MultiOutput extends LogOutput {
final List<LogOutput> outputs;
MultiOutput({required this.outputs});
@override
Future<void> destroy() async {
for (final output in outputs)
await output.destroy();
}
@override
Future<void> init() async {
for (final output in outputs)
await output.init();
}
@override
void output(OutputEvent event) {
for (final output in outputs)
output.output(event);
}
}
Good luck :)
Is it possible to have a different printer for each output specified in
MultiOutput()
? I can't see a good way to do that.