Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2][log] TargetKind::LogDir not working on mobile #1257

Open
universalappfactory opened this issue Apr 27, 2024 · 0 comments
Open

[v2][log] TargetKind::LogDir not working on mobile #1257

universalappfactory opened this issue Apr 27, 2024 · 0 comments
Labels
bug Something isn't working platform: android Android specific issues platform: ios iOS specific issues plugin: log

Comments

@universalappfactory
Copy link

universalappfactory commented Apr 27, 2024

Hi guys, first of all, thanks for the amazing tauri v2 works.

It seems, the logfile is not set when running on a mobile platform.

plugins/log/src/lib.rs:

#[cfg(mobile)]
TargetKind::LogDir { .. } => continue,
#[cfg(desktop)]
TargetKind::LogDir { file_name } => {
 let path = app_handle.path().app_log_dir().unwrap();
  if !path.exists() {
      fs::create_dir_all(&path).unwrap();
  }
  fern::log_file(get_log_file_path(
      &path,
      file_name.as_deref().unwrap_or(app_name),
      &self.rotation_strategy,
      &self.timezone_strategy,
      self.max_file_size,
  )?)?
  .into()
}

From my understanding a #[cfg(any(desktop, mobile)] would be sufficient as the app_log_dir() function is already implemented for mobile.

@FabianLars FabianLars added bug Something isn't working platform: android Android specific issues plugin: log platform: ios iOS specific issues labels Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: android Android specific issues platform: ios iOS specific issues plugin: log
Projects
None yet
Development

No branches or pull requests

2 participants