rename the fmt mode to human

This commit is contained in:
Tamo 2024-02-08 13:59:30 +01:00 committed by Louis Dureuil
parent 35aa9d5904
commit 2c88131bb1
No known key found for this signature in database
3 changed files with 8 additions and 8 deletions

View File

@ -36,7 +36,7 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
#[deserr(rename_all = lowercase)]
pub enum LogMode {
#[default]
Fmt,
Human,
Profile,
}
@ -160,7 +160,7 @@ fn make_layer<
) -> (Box<dyn Layer<S> + Send + Sync>, PinnedByteStream) {
let guard = HandleGuard { logs: logs.into_inner() };
match opt.mode {
LogMode::Fmt => {
LogMode::Human => {
let (sender, receiver) = tokio::sync::mpsc::unbounded_channel();
let fmt_layer = tracing_subscriber::fmt::layer()

View File

@ -89,7 +89,7 @@ async fn logs_stream_bad_mode() {
snapshot!(code, @"400 Bad Request");
snapshot!(response, @r###"
{
"message": "Unknown value `tamo` at `.mode`: expected one of `fmt`, `profile`",
"message": "Unknown value `tamo` at `.mode`: expected one of `human`, `profile`",
"code": "bad_request",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#bad_request"
@ -133,7 +133,7 @@ async fn logs_stream_bad_profile_memory() {
snapshot!(code, @"400 Bad Request");
snapshot!(response, @r###"
{
"message": "Invalid value: `profile_memory` can only be used while profiling code and is not compatible with the Fmt mode.",
"message": "Invalid value: `profile_memory` can only be used while profiling code and is not compatible with the Human mode.",
"code": "invalid_settings_typo_tolerance",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_settings_typo_tolerance"
@ -146,10 +146,10 @@ async fn logs_stream_bad_profile_memory() {
snapshot!(code, @"400 Bad Request");
snapshot!(response, @r###"
{
"message": "Invalid value: `profile_memory` can only be used while profiling code and is not compatible with the Fmt mode.",
"code": "invalid_settings_typo_tolerance",
"message": "Unknown value `fmt` at `.mode`: expected one of `human`, `profile`",
"code": "bad_request",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_settings_typo_tolerance"
"link": "https://docs.meilisearch.com/errors#bad_request"
}
"###);
}

View File

@ -57,7 +57,7 @@ async fn basic_test_log_stream_route() {
.insert_header(ContentType::json())
.set_payload(
serde_json::to_vec(&json!({
"mode": "fmt",
"mode": "human",
"target": "info",
}))
.unwrap(),