Skip to content

Commit 5dd9dc2

Browse files
committed
Merge remote-tracking branch 'upstream/main' into main
2 parents 0341865 + 9f3cde6 commit 5dd9dc2

28 files changed

+77
-89
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rustdoc-args = ["--cfg", "feature=\"docs\""]
2727
default = ["h1-server"]
2828
cookies = ["http-types/cookies"]
2929
h1-server = ["async-h1"]
30-
logger = ["femme"]
30+
logger = []
3131
docs = ["unstable"]
3232
sessions = ["async-session", "cookies"]
3333
sse = ["async-sse"]
@@ -39,7 +39,6 @@ async-session = { version = "3.0", optional = true }
3939
async-sse = { version = "5.1.0", optional = true }
4040
async-std = { version = "1.6.5", features = ["unstable"] }
4141
async-trait = "0.1.41"
42-
femme = { version = "2.1.1", optional = true }
4342
futures-util = "0.3.6"
4443
http-client = { version = "6.1.0", default-features = false }
4544
http-types = { version = "2.11.0", default-features = false, features = ["fs"] }
@@ -54,7 +53,9 @@ regex = "1.5.5"
5453
[dev-dependencies]
5554
async-std = { version = "1.6.5", features = ["unstable", "attributes"] }
5655
criterion = "0.3.3"
56+
femme = "2.1.1"
5757
juniper = "0.14.2"
58+
kv-log-macro = "1.0.7"
5859
lazy_static = "1.4.0"
5960
logtest = "2.0.0"
6061
portpicker = "0.1.0"

examples/catflap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#[async_std::main]
33
async fn main() -> Result<(), std::io::Error> {
44
use std::{env, net::TcpListener, os::unix::io::FromRawFd};
5-
tide::log::start();
5+
femme::start();
66
let mut app = tide::new();
77
app.with(tide::log::LogMiddleware::new());
88
app.at("/").get(|_| async { Ok(CHANGE_THIS_TEXT) });

examples/chunked.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use tide::Body;
22

33
#[async_std::main]
44
async fn main() -> Result<(), std::io::Error> {
5-
tide::log::start();
5+
femme::start();
66
let mut app = tide::new();
77
app.with(tide::log::LogMiddleware::new());
88
app.at("/").get(|_| async {

examples/concurrent_listeners.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use tide::Request;
22

33
#[async_std::main]
44
async fn main() -> Result<(), std::io::Error> {
5-
tide::log::start();
5+
femme::start();
66
let mut app = tide::new();
77
app.with(tide::log::LogMiddleware::new());
88

examples/cookies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async fn remove_cookie(_req: Request) -> tide::Result {
2121

2222
#[async_std::main]
2323
async fn main() -> Result<(), std::io::Error> {
24-
tide::log::start();
24+
femme::start();
2525
let mut app = tide::new();
2626
app.with(tide::log::LogMiddleware::new());
2727

examples/error_handling.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use tide::{Body, Request, Response, Result, StatusCode};
55

66
#[async_std::main]
77
async fn main() -> Result<()> {
8-
tide::log::start();
8+
femme::start();
99
let mut app = tide::new();
1010
app.with(tide::log::LogMiddleware::new());
1111

examples/hello.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[async_std::main]
22
async fn main() -> Result<(), std::io::Error> {
3-
tide::log::start();
3+
femme::start();
44

55
let mut app = tide::new();
66
app.with(tide::log::LogMiddleware::new());

examples/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct Cat {
99

1010
#[async_std::main]
1111
async fn main() -> tide::Result<()> {
12-
tide::log::start();
12+
femme::start();
1313
let mut app = tide::new();
1414
app.with(tide::log::LogMiddleware::new());
1515

examples/middleware.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::sync::atomic::{AtomicUsize, Ordering};
22
use std::sync::Arc;
33

4+
use kv_log_macro::trace;
45
use tide::http::mime;
56
use tide::utils::{After, Before};
67
use tide::{Middleware, Next, Request, Response, Result, StatusCode};
@@ -25,7 +26,7 @@ impl UserDatabase {
2526
// it would likely be closely tied to a specific application
2627
async fn user_loader(mut request: Request, next: Next) -> Result {
2728
if let Some(user) = request.state::<UserDatabase>().find_user().await {
28-
tide::log::trace!("user loaded", {user: user.name});
29+
trace!("user loaded", {user: user.name});
2930
request.set_ext(user);
3031
Ok(next.run(request).await)
3132
// this middleware only needs to run before the endpoint, so
@@ -57,7 +58,7 @@ struct RequestCount(usize);
5758
impl Middleware for RequestCounterMiddleware {
5859
async fn handle(&self, mut req: Request, next: Next) -> Result {
5960
let count = self.requests_counted.fetch_add(1, Ordering::Relaxed);
60-
tide::log::trace!("request counter", { count: count });
61+
trace!("request counter", { count: count });
6162
req.set_ext(RequestCount(count));
6263

6364
let mut res = next.run(req).await;
@@ -84,7 +85,7 @@ const INTERNAL_SERVER_ERROR_HTML_PAGE: &str = "<html><body>
8485

8586
#[async_std::main]
8687
async fn main() -> Result<()> {
87-
tide::log::start();
88+
femme::start();
8889
let mut app = tide::with_state(UserDatabase::default());
8990

9091
app.with(After(|response: Response| async move {

examples/nested.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[async_std::main]
22
async fn main() -> Result<(), std::io::Error> {
3-
tide::log::start();
3+
femme::start();
44
let mut app = tide::new();
55
app.with(tide::log::LogMiddleware::new());
66
app.at("/").get(|_| async { Ok("Root") });

0 commit comments

Comments
 (0)