diff options
| author | bors <bors@rust-lang.org> | 2014-05-05 15:26:31 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-05-05 15:26:31 -0700 |
| commit | 7583544fb541b9822dd658e5bf7aae1233cb5794 (patch) | |
| tree | 7688efdf8aaee7d6c0b2b34a40ab556b76a71986 /src/libstd | |
| parent | 600507d5380ca7d6d5536fabc2d4aca400c21bb9 (diff) | |
| parent | ceb29314a7e6fc2d9f3527e36534b2d1608394d8 (diff) | |
| download | rust-7583544fb541b9822dd658e5bf7aae1233cb5794.tar.gz rust-7583544fb541b9822dd658e5bf7aae1233cb5794.zip | |
auto merge of #13912 : seanmonstar/rust/logrecord, r=alexcrichton
The logging macros now create a LogRecord, and pass that to the Logger. This will allow custom loggers to change the formatting, and possible filter on more properties of the log record. DefaultLogger's formatting was taken from Python's default formatting: `LEVEL:from: message` Also included: fmt::Arguments now implement Show, so they can be used to extend format strings. @alexcrichton r?
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/fmt/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index 8e4d8707cca..e225dc42e05 100644 --- a/src/libstd/fmt/mod.rs +++ b/src/libstd/fmt/mod.rs @@ -565,6 +565,12 @@ pub struct Arguments<'a> { args: &'a [Argument<'a>], } +impl<'a> Show for Arguments<'a> { + fn fmt(&self, fmt: &mut Formatter) -> Result { + write(fmt.buf, self) + } +} + /// When a format is not otherwise specified, types are formatted by ascribing /// to this trait. There is not an explicit way of selecting this trait to be /// used for formatting, it is only if no other format is specified. |
