mirror of
https://github.com/actix/actix-web.git
synced 2024-05-08 03:23:06 +00:00
Compare commits
6 commits
bec4d70946
...
7a14853b62
Author | SHA1 | Date | |
---|---|---|---|
7a14853b62 | |||
ba7fd048b6 | |||
d98938b125 | |||
5a5486b484 | |||
76b2b2734b | |||
7d659229f6 |
6
.github/workflows/ci-post-merge.yml
vendored
6
.github/workflows/ci-post-merge.yml
vendored
|
@ -45,7 +45,7 @@ jobs:
|
|||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install cargo-hack and cargo-ci-cache-clean
|
||||
uses: taiki-e/install-action@v2.32.0
|
||||
uses: taiki-e/install-action@v2.32.17
|
||||
with:
|
||||
tool: cargo-hack,cargo-ci-cache-clean
|
||||
|
||||
|
@ -88,7 +88,7 @@ jobs:
|
|||
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
|
||||
|
||||
- name: Install cargo-hack
|
||||
uses: taiki-e/install-action@v2.32.0
|
||||
uses: taiki-e/install-action@v2.32.17
|
||||
with:
|
||||
tool: cargo-hack
|
||||
|
||||
|
@ -109,7 +109,7 @@ jobs:
|
|||
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
|
||||
|
||||
- name: Install nextest
|
||||
uses: taiki-e/install-action@v2.32.0
|
||||
uses: taiki-e/install-action@v2.32.17
|
||||
with:
|
||||
tool: nextest
|
||||
|
||||
|
|
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -50,7 +50,7 @@ jobs:
|
|||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install cargo-hack and cargo-ci-cache-clean
|
||||
uses: taiki-e/install-action@v2.32.0
|
||||
uses: taiki-e/install-action@v2.32.17
|
||||
with:
|
||||
tool: cargo-hack,cargo-ci-cache-clean
|
||||
|
||||
|
|
4
.github/workflows/coverage.yml
vendored
4
.github/workflows/coverage.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
components: llvm-tools-preview
|
||||
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@v2.32.0
|
||||
uses: taiki-e/install-action@v2.32.17
|
||||
with:
|
||||
tool: cargo-llvm-cov
|
||||
|
||||
|
@ -31,7 +31,7 @@ jobs:
|
|||
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4.1.1
|
||||
uses: codecov/codecov-action@v4.3.0
|
||||
with:
|
||||
files: codecov.json
|
||||
fail_ci_if_error: true
|
||||
|
|
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
|
@ -82,7 +82,7 @@ jobs:
|
|||
toolchain: nightly-2023-08-25
|
||||
|
||||
- name: Install cargo-public-api
|
||||
uses: taiki-e/install-action@v2.32.0
|
||||
uses: taiki-e/install-action@v2.32.17
|
||||
with:
|
||||
tool: cargo-public-api
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use actix_service::{Service, Transform};
|
|||
use actix_utils::future::{ready, Ready};
|
||||
use bytes::Bytes;
|
||||
use futures_core::ready;
|
||||
use log::{debug, warn};
|
||||
use log::{debug, warn, Level};
|
||||
use pin_project_lite::pin_project;
|
||||
#[cfg(feature = "unicode")]
|
||||
use regex::Regex;
|
||||
|
@ -367,6 +367,12 @@ where
|
|||
debug!("Error in response: {:?}", error);
|
||||
}
|
||||
|
||||
let level = match res.response().status().as_u16() {
|
||||
300..=499 => Level::Warn,
|
||||
500..=599 => Level::Error,
|
||||
_ => Level::Info,
|
||||
};
|
||||
|
||||
let res = if let Some(ref mut format) = this.format {
|
||||
// to avoid polluting all the Logger types with the body parameter we swap the body
|
||||
// out temporarily since it's not usable in custom response functions anyway
|
||||
|
@ -397,6 +403,7 @@ where
|
|||
format,
|
||||
size: 0,
|
||||
log_target,
|
||||
level,
|
||||
})))
|
||||
}
|
||||
}
|
||||
|
@ -409,6 +416,7 @@ pin_project! {
|
|||
size: usize,
|
||||
time: OffsetDateTime,
|
||||
log_target: Cow<'static, str>,
|
||||
level: Level,
|
||||
}
|
||||
|
||||
impl<B> PinnedDrop for StreamLog<B> {
|
||||
|
@ -421,8 +429,9 @@ pin_project! {
|
|||
Ok(())
|
||||
};
|
||||
|
||||
log::info!(
|
||||
log::log!(
|
||||
target: this.log_target.as_ref(),
|
||||
this.level,
|
||||
"{}", FormatDisplay(&render)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue