Skip to content

Commit 47866dd

Browse files
authored
Merge pull request #755 from jbr/remove-logger-from-default-middleware
remove the logger from the default middleware
2 parents 7baf574 + 14a85b3 commit 47866dd

17 files changed

+19
-2
lines changed

examples/catflap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ async fn main() -> Result<(), std::io::Error> {
44
use std::{env, net::TcpListener, os::unix::io::FromRawFd};
55
tide::log::start();
66
let mut app = tide::new();
7+
app.with(tide::log::LogMiddleware::new());
78
app.at("/").get(|_| async { Ok(CHANGE_THIS_TEXT) });
89

910
const CHANGE_THIS_TEXT: &str = "hello world!";

examples/chunked.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use tide::Body;
44
async fn main() -> Result<(), std::io::Error> {
55
tide::log::start();
66
let mut app = tide::new();
7+
app.with(tide::log::LogMiddleware::new());
78
app.at("/").get(|_| async {
89
// File sends are chunked by default.
910
Ok(Body::from_file(file!()).await?)

examples/concurrent_listeners.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use tide::Request;
44
async fn main() -> Result<(), std::io::Error> {
55
tide::log::start();
66
let mut app = tide::new();
7+
app.with(tide::log::LogMiddleware::new());
78

89
app.at("/").get(|request: Request<_>| async move {
910
Ok(format!(

examples/cookies.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ async fn remove_cookie(_req: Request<()>) -> tide::Result {
2323
async fn main() -> Result<(), std::io::Error> {
2424
tide::log::start();
2525
let mut app = tide::new();
26+
app.with(tide::log::LogMiddleware::new());
2627

2728
app.at("/").get(retrieve_cookie);
2829
app.at("/set").get(insert_cookie);

examples/error_handling.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use tide::{Body, Request, Response, Result, StatusCode};
77
async fn main() -> Result<()> {
88
tide::log::start();
99
let mut app = tide::new();
10+
app.with(tide::log::LogMiddleware::new());
1011

1112
app.with(After(|mut res: Response| async {
1213
if let Some(err) = res.downcast_error::<async_std::io::Error>() {

examples/hello.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#[async_std::main]
22
async fn main() -> Result<(), std::io::Error> {
33
tide::log::start();
4+
45
let mut app = tide::new();
6+
app.with(tide::log::LogMiddleware::new());
7+
58
app.at("/").get(|_| async { Ok("Hello, world!") });
69
app.listen("127.0.0.1:8080").await?;
710
Ok(())

examples/json.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ struct Cat {
1111
async fn main() -> tide::Result<()> {
1212
tide::log::start();
1313
let mut app = tide::new();
14+
app.with(tide::log::LogMiddleware::new());
1415

1516
app.at("/submit").post(|mut req: Request<()>| async move {
1617
let cat: Cat = req.body_json().await?;

examples/nested.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
async fn main() -> Result<(), std::io::Error> {
33
tide::log::start();
44
let mut app = tide::new();
5+
app.with(tide::log::LogMiddleware::new());
56
app.at("/").get(|_| async { Ok("Root") });
67
app.at("/api").nest({
78
let mut api = tide::new();

examples/redirect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use tide::{Redirect, Response, StatusCode};
44
async fn main() -> Result<(), std::io::Error> {
55
tide::log::start();
66
let mut app = tide::new();
7+
app.with(tide::log::LogMiddleware::new());
78
app.at("/").get(|_| async { Ok("Root") });
89

910
// Redirect hackers to YouTube.

examples/sessions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
async fn main() -> Result<(), std::io::Error> {
33
tide::log::start();
44
let mut app = tide::new();
5+
app.with(tide::log::LogMiddleware::new());
56

67
app.with(tide::sessions::SessionMiddleware::new(
78
tide::sessions::MemoryStore::new(),

0 commit comments

Comments
 (0)