-
Notifications
You must be signed in to change notification settings - Fork 23
logging: introduce appenders #415
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
Comments
<img src="https://avatars.githubusercontent.com/u/2909286?v=3" align="left" width="48" height="48"hspace="10"> Comment by madsager cc @gramster. |
<img src="https://avatars.githubusercontent.com/u/4865287?v=3" align="left" width="48" height="48"hspace="10"> Comment by lrhn Removed Type-Defect label. |
<img src="https://avatars.githubusercontent.com/u/4865287?v=3" align="left" width="48" height="48"hspace="10"> Comment by lrhn Removed Area-Library label. |
<img src="https://avatars.githubusercontent.com/u/3276024?v=3" align="left" width="48" height="48"hspace="10"> Comment by anders-sandholm Removed Library-Logging label. |
var output = File('logs').openWrite();
logStrings.forEach(output.writeln); |
<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="96" height="96"hspace="10"> Issue by seaneagan
Originally opened as dart-lang/sdk#12028
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 dart-lang/pub#458), a remote system (issue #410), 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: