Open DartBot opened 9 years ago
There are other issues that are pointing to this. Can one of the core maintainers specify a list of features that requires implementation so that someone can work on them?
Logs from apps running on cloud services like GCP Logging, are usually expected to be in a structured format. So having the ability to use custom formatters for logs would be helpful for parsing and setting alerts.
Can one of the core maintainers specify a list of features that requires implementation so that someone can work on them?
I don't think we have done that level of triaging, and I'm not sure we'll realistically be able to any time soon.
having the ability to use custom formatters for logs would be helpful for parsing and setting alerts.
There are not any blockers to you defining custom formatters. The main question is whether there are formats that are universal enough to warrant shipping in the shared package. So far I'm not convinced there are - I don't think we could define a format that enough folks would want to make it worth defining here instead of defining elsewhere. It would also be easy for someone to write an external package like package:log_format
that exposes one or more String Function(LogRecord)
for reuse.
Issue by seaneagan Originally opened as dart-lang/sdk#12030
The logging package should provide support for converting LogRecords into Strings.
In Java's logback these are called Layouts:
http://logback.qos.ch/manual/layouts.html
For example:
class LogFormat { String format(LogRecord record); }
Then can use it like so:
logger.onRecord.map(logFormat.format)