logging: introduce appenders #12028
Labels
area-pkg
Used for miscellaneous pkg/ packages not associated with specific area- teams.
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by @seaneagan
Currently, we have Logger.onRecord, and you can do something simple like:
logger.onRecord.map((record) => formatRecord(record)).listen(print);
But there is no easy way to log to a file (issue #8686), a remote system (issue #8443), etc.
In Java's logback this is handled by Appenders:
http://logback.qos.ch/manual/appenders.html
Appenders in dart could implement one of the Sink interfaces, possibly StreamSink<String> ? Maybe instead call it LineSink ? LogSink ?
then could do something like:
logger.onRecord.pipe(new ConsoleLineSink());
The text was updated successfully, but these errors were encountered: