Skip to content

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

Closed
DartBot opened this issue Jun 5, 2015 · 5 comments
Closed

logging: introduce appenders #415

DartBot opened this issue Jun 5, 2015 · 5 comments
Labels
package:logging type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<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());

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2909286?v=3" align="left" width="48" height="48"hspace="10"> Comment by madsager


cc @gramster.
cc @sigmundch.
Added Area-Library, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<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.
Added Type-Enhancement, Library-Logging labels.

@DartBot DartBot added the type-enhancement A request for a change that isn't a bug label Jun 5, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<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.
Added Area-Pkg label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<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.
Added Pkg-Logging label.

@natebosch
Copy link
Member

File.openWrite() gives an IOSink. To dump a Stream<String> it could be something like:

var output = File('logs').openWrite();
logStrings.forEach(output.writeln);

@mosuem mosuem transferred this issue from dart-archive/logging Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:logging type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants