pub struct ConfigValueGroup {
pub dest: Option<String>,
pub format: Option<String>,
pub prefix: String,
pub dir_disable_cleanup: bool,
pub dir_max_size: ByteSize,
pub dir_min_deletion_age: Duration,
pub dir_max_retention_age: Duration,
}Expand description
ConfigValueGroup struct containing all configurable values
Fields§
§dest: Option<String>The log destination. By default, logs to the logs/ subdirectory in the huggingface xet cache directory.
If this path exists as a directory or the path ends with a /, then logs will be dumped into to that directory. Dy default, logs older than LOG_DIR_MAX_RETENTION_AGE in the directory are deleted, and old logs are deleted to keep the total size of files present below LOG_DIR_MAX_SIZE.
If LOG_DEST is given but empty, then logs are dumped to the console.
The default value is None.
Use the environment variable HF_XET_LOG_DEST to set this value.
format: Option<String>The format the logs are printed in. If “json”, then logs are dumped as json blobs; otherwise they are treated as text. By default logging to files is done in json and console logging is done with text.
The default value is None.
Use the environment variable HF_XET_LOG_FORMAT to set this value.
prefix: StringThe base name for a log file when logging to a directory. The timestamp and pid are appended to this name to form the log file.
The default value is “xet”.
Use the environment variable HF_XET_LOG_PREFIX to set this value.
dir_disable_cleanup: boolIf given, disable cleaning up old files in the log directory.
The default value is false.
Use the environment variable HF_XET_LOG_DIR_DISABLE_CLEANUP to set this value.
dir_max_size: ByteSizeIf given, prune old log files in the directory to keep the directory size under this many bytes.
Note that the directory may exceed this size as pruning is done only on files without an associated active process and older than LOG_DIR_MIN_DELETION_AGE.
The default value is 250mb.
Use the environment variable HF_XET_LOG_DIR_MAX_SIZE to set this value.
dir_min_deletion_age: DurationDo not delete any files younger than this.
The default value is 1day.
Use the environment variable HF_XET_LOG_DIR_MIN_DELETION_AGE to set this value.
dir_max_retention_age: DurationDelete all files older than this.
The default value is 14day.
Use the environment variable HF_XET_LOG_DIR_MAX_RETENTION_AGE to set this value.
Implementations§
Source§impl ConfigValueGroup
impl ConfigValueGroup
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance with default values only (no environment variable overrides).
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
Apply environment variable overrides to this configuration group.
The group name is derived from the module path. For example, in module xet_config::groups::data,
the env var for TEST_INT would be HF_XET_DATA_TEST_INT.
Sourcepub fn field_names() -> &'static [&'static str]
pub fn field_names() -> &'static [&'static str]
Returns the list of field names in this configuration group.
Trait Implementations§
Source§impl AsRef<ConfigValueGroup> for ConfigValueGroup
impl AsRef<ConfigValueGroup> for ConfigValueGroup
Source§fn as_ref(&self) -> &ConfigValueGroup
fn as_ref(&self) -> &ConfigValueGroup
Source§impl Clone for ConfigValueGroup
impl Clone for ConfigValueGroup
Source§fn clone(&self) -> ConfigValueGroup
fn clone(&self) -> ConfigValueGroup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more