Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/slog-rs/html

Html formatter for slog-rs
https://github.com/slog-rs/html

formatter html logging logging-library

Last synced: 15 days ago
JSON representation

Html formatter for slog-rs

Awesome Lists containing this project

README

        



slog-rs logo



Travis CI Build Status


AppVeyor Build Status


slog-html on crates.io


slog-rs Gitter Chat


slog-html documentation

# slog-html - HTML format for [slog-stream] of [slog-rs]

[slog-rs]: //github.com/slog-rs/slog
[slog-stream]: //github.com/slog-rs/stream

## Example

```rust
#[macro_use]
extern crate slog;
extern crate slog_html;
extern crate slog_stream;

use slog::DrainExt;

use std::fs::OpenOptions;

fn main() {
let file = OpenOptions::new()
.create(true)
.write(true)
.truncate(true)
.open("target/log.html").unwrap();

let log = slog::Logger::root(
slog_stream::stream(
file,
slog_html::default()
).fuse(),
o!("version" => env!("CARGO_PKG_VERSION"))
);

debug!(log, "debug values"; "x" => 1, "y" => -1);
}
```

## Rendered example output

slog-rs html full-format output

Compact mode:

slog-rs html compact output

Full mode:

slog-rs html full output