Logging + config tweaks
This commit is contained in:
@@ -99,7 +99,7 @@ pub struct FieldSpec {
|
|||||||
pub r#type: FieldType,
|
pub r#type: FieldType,
|
||||||
|
|
||||||
/// How to find this field in a data entry
|
/// How to find this field in a data entry
|
||||||
pub path: OneOrMany<ObjectPath>,
|
pub path: Vec<ObjectPath>,
|
||||||
|
|
||||||
/// How to post-process this field
|
/// How to post-process this field
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
|||||||
@@ -1,33 +1,9 @@
|
|||||||
use core::slice;
|
|
||||||
use std::fmt::{Debug, Display};
|
use std::fmt::{Debug, Display};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use smartstring::{LazyCompact, SmartString};
|
use smartstring::{LazyCompact, SmartString};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
|
||||||
#[serde(untagged)]
|
|
||||||
pub enum OneOrMany<T: Debug + Clone> {
|
|
||||||
One(T),
|
|
||||||
Many(Vec<T>),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T: Debug + Clone> OneOrMany<T> {
|
|
||||||
pub fn to_vec(self) -> Vec<T> {
|
|
||||||
match self {
|
|
||||||
Self::One(x) => vec![x],
|
|
||||||
Self::Many(x) => x,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn as_slice(&self) -> &[T] {
|
|
||||||
match self {
|
|
||||||
Self::One(x) => slice::from_ref(x),
|
|
||||||
Self::Many(x) => &x[..],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// MARK: Label
|
// MARK: Label
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -53,6 +53,12 @@ impl From<LoggingConfig> for EnvFilter {
|
|||||||
// Fixed sources
|
// Fixed sources
|
||||||
format!("html5ever={}", LogLevel::Error),
|
format!("html5ever={}", LogLevel::Error),
|
||||||
format!("tantivy={}", LogLevel::Error),
|
format!("tantivy={}", LogLevel::Error),
|
||||||
|
format!("aws_smithy_runtime={}", LogLevel::Error),
|
||||||
|
format!("aws_smithy_http_client={}", LogLevel::Error),
|
||||||
|
format!("aws_sdk_s3={}", LogLevel::Error),
|
||||||
|
format!("aws_sigv4={}", LogLevel::Error),
|
||||||
|
format!("hyper_util={}", LogLevel::Error),
|
||||||
|
format!("pdf={}", LogLevel::Warn),
|
||||||
// Configurable sources
|
// Configurable sources
|
||||||
format!("pile={}", conf.pile),
|
format!("pile={}", conf.pile),
|
||||||
format!("pile_flac={}", conf.pile_flac),
|
format!("pile_flac={}", conf.pile_flac),
|
||||||
|
|||||||
Reference in New Issue
Block a user