On 23 June 2011 20:51, Brian Anderson <[email protected]> wrote:
> We had a discussion today about what belongs in the standard library.
> Here are the notes, which are also available on the wiki.
Hmm, no mention of logging. Did this come up at all?
>From what I can see, Rust's logging facilities are geared toward
current dogfood usage, i.e. line-based direct to stderr. For server
apps running as part of a big farm, or thick-client apps running on an
end-user desktop, this isn't very helpful; what's wanted is to batch
up the error log with any note logs associated with it, and send it
off to a central logging DB.
In itself this isn't too scary; one can envisage plugging in a log
handler backend that can batch/sort/filter/flush individual log lines,
trigger notifications etc. These backends probably don't belong in
std. But the hooks for them do, especially since they may point to
syntax changes. For example, I think there's a case to be made for
combining the current
log_err("oops");
fail;
idiom into a single
fail("oops");
expression, because in the idiomatic version there's no way for a
batching log handler to unambiguously associate the error log with the
failure, and thus with any note logs associated with the failure's
unwinding.
(I'm also having trouble seeing how I could get high-level context,
e.g. from top-level or intermediate task scope, included in a log
batch. Current docs mention callers getting notified of task failure,
but I haven't found any specifics.)
cheers,
Mike
Disclaimer: as a noncontributing lurker, all opinions expressed above
should be multiplied by a meritocratic weighting factor of 0.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev