Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/slog-rs/html
- Owner: slog-rs
- License: mpl-2.0
- Created: 2017-01-13T06:55:31.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-04T10:27:07.000Z (almost 8 years ago)
- Last Synced: 2024-10-14T08:24:42.323Z (about 1 month ago)
- Topics: formatter, html, logging, logging-library
- Language: Rust
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-MPL2
Awesome Lists containing this project
README
# 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
Compact mode:
Full mode: