Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions lading/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,18 @@ pub struct Output {
pub stdout: Behavior,
}

#[derive(Debug, Deserialize, Clone, PartialEq, Eq)]
#[derive(Debug, Deserialize, Clone, PartialEq, Eq, Default)]
#[serde(deny_unknown_fields)]
#[serde(untagged)]
/// Defines the [`Output`] behavior for stderr and stdout.
pub enum Behavior {
#[default]
/// Redirect stdout, stderr to /dev/null
Quiet,
/// Write to a location on-disk.
Log(PathBuf),
}

impl Default for Behavior {
fn default() -> Self {
Self::Quiet
}
}

impl fmt::Display for Behavior {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
match self {
Expand Down
Loading
Loading