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
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion examples/lading-logrotatefs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ generator:
max_depth: 0
variant: "ascii"
load_profile:
constant: 1.3MiB
constant:
rate:
bytes_per_second: 1.3MiB
maximum_prebuild_cache_size_bytes: 1GiB
mount_point: /tmp/logrotate

Expand Down
6 changes: 6 additions & 0 deletions lading/src/bin/lading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,12 @@ fn main() -> Result<(), Error> {
"Lading running with {limit} amount of memory.",
limit = memory_limit.to_string()
);
if let Ok(limit_v1) = std::fs::read_to_string("/sys/fs/cgroup/memory/memory.limit_in_bytes") {
info!("cgroup v1 memory.limit_in_bytes: {}", limit_v1.trim());
}
if let Ok(max_v2) = std::fs::read_to_string("/sys/fs/cgroup/memory.max") {
info!("cgroup v2 memory.max: {}", max_v2.trim());
}

// Two-parser fallback logic until CliFlatLegacy is removed
let args = match CliWithSubcommands::try_parse() {
Expand Down
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 {
/// Redirect stdout, stderr to /dev/null
#[default]
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