5 releases

0.0.6 Feb 3, 2021
0.0.5 Dec 2, 2020
0.0.4 Oct 19, 2020
0.0.3 Sep 6, 2020
0.0.1 Sep 5, 2020

#9 in #tide

Download history 17/week @ 2021-01-16 34/week @ 2021-01-23 43/week @ 2021-01-30 26/week @ 2021-02-06 73/week @ 2021-02-13 8/week @ 2021-02-20 39/week @ 2021-02-27 33/week @ 2021-03-06 23/week @ 2021-03-13 45/week @ 2021-03-20 20/week @ 2021-03-27 20/week @ 2021-04-03 43/week @ 2021-04-10 38/week @ 2021-04-17 28/week @ 2021-04-24 24/week @ 2021-05-01

113 downloads per month
Used in 4 crates

MIT/Apache

10KB
151 lines

driftwood

some logs on the tide

Installation

$ cargo add driftwood

Usage

This crate currently provides three loggers:

Apache common log format

let mut app = tide::new();
app.with(driftwood::ApacheCommonLogger);

Example: 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326

Apache combined log format

let mut app = tide::new();
app.with(driftwood::ApacheCombinedLogger);

Example: 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"

Dev logger

let mut app = tide::new();
app.with(driftwood::DevLogger);

This logger colors the status code based on the status range and is intended to be read by people

Example: GET http://localhost:8080/some/path 200 3.289292ms 227bytes

Intent

This crate intends to support much of the functionality in morgan including custom log formats and may eventually support writing to outputs other than stdout.

Safety

This crate uses #![deny(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~7.5–10MB
~202K SLoC