Skip to main content

LogConfig

Type Alias LogConfig 

Source
pub type LogConfig = ConfigValueGroup;

Aliased Type§

pub struct LogConfig {
    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,
}

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: String

The 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: bool

If 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: ByteSize

If 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: Duration

Do 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: Duration

Delete 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.