pub fn prepare_log_dir(dir: &Path) -> Result<()>
Creates dir if needed and makes sure only the current user can access it.
dir