SourceHorizon / logger

Small, easy to use and extensible logger which prints beautiful logs.
https://pub.dev/packages/logger
MIT License
197 stars 33 forks source link

Different levels for different LogOutput? #55

Closed busslina closed 7 months ago

busslina commented 7 months ago

When using MultiOutput, is it possible to have info level for ConsoleOutput and all level fro FileOutput?

Bungeefan commented 7 months ago

Hi, sorry for the late response. No, this is currently not possible because the LogOutput (like MultiOutput) is not the one checking or managing the configured log level. The LogFilter is responsible for comparing the log level, and there is currently no way of having a separate filter per output.

Sidenote: The current logger architecture isn't designed for multiple filters/outputs and the MultiOutput is more or less a workaround, IMO.

A possible alternative would be to use two loggers (one for console, one for file) with different log levels.

busslina commented 7 months ago

@Bungeefan thank you ;)