MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / open_file

Function open_file

atomic-cli/src/logging/mod.rs:297–308  ·  view source on GitHub ↗
(dir: &Path)

Source from the content-addressed store, hash-verified

295}
296
297fn open_file(dir: &Path) -> Result<RollingFileAppender, OpenError> {
298 if !dir.is_absolute() {
299 return Err(OpenError::Relative);
300 }
301 create_private_dir(dir).map_err(OpenError::Create)?;
302 RollingFileAppender::builder()
303 .rotation(Rotation::DAILY)
304 .filename_prefix(LOG_FILE_PREFIX)
305 .filename_suffix(LOG_FILE_SUFFIX)
306 .build(dir)
307 .map_err(OpenError::Init)
308}
309
310/// Create the log directory readable by its owner only: the file records
311/// working directories, paths and error text. An existing directory keeps

Callers 3

initFunction · 0.85
a_new_log_dir_is_privateFunction · 0.85

Calls 2

create_private_dirFunction · 0.85
buildMethod · 0.45

Tested by 2

a_new_log_dir_is_privateFunction · 0.68