emabee / flexi_logger

A flexible logger for rust programs that can write to stderr, stdout, and/or to log files
Apache License 2.0
307 stars 50 forks source link

GlobError unwrap happens #152

Closed 21pages closed 10 months ago

21pages commented 10 months ago

https://github.com/rustdesk/rustdesk/issues/3556#issuecomment-1804010109

Abort message: 'called Result::unwrap() on an Err value: GlobError { path: "/storage/emulated/0/RustDesk/Logs", error: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } }'

version: 0.25.6, maybe related to https://github.com/emabee/flexi_logger/blob/721f8e28e4c536ebdc5d4449a6268af0e0ad67d6/src/writers/file_log_writer/state.rs#L556 https://github.com/emabee/flexi_logger/blob/721f8e28e4c536ebdc5d4449a6268af0e0ad67d6/src/writers/file_log_writer/state.rs#L682

emabee commented 10 months ago

Only the latter is critical, I think. The first one already does .filter_map(Result::ok), i.e., ignores errors silently. The second one did .map(Result::unwrap), and now also does .filter_map(Result::ok).

21pages commented 10 months ago

If the PermissionDenied error is caused by glob::glob, does it mean there is no read directory permission?

emabee commented 10 months ago

I really do not know. Would be very much interested in more details.