mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-01-24 09:55:20 +01:00
fix(log): Logging System Improvements and Error Handling Enhancements (#994)
* fix: Added logging to exception handling Added detailed error logging to exception handling across multiple files, including exception information and stack traces, to facilitate troubleshooting. * refactor(logging): Standardize logging output methods Replace existing debugPrint and lprint with Loggers.app.warning to enhance logging consistency and maintainability. * refactor: Remove redundant debug log prints Clean up unnecessary log print statements in debug code * feat(i18n): Added internationalization support for the logging feature
This commit is contained in:
@@ -74,8 +74,8 @@ class BackupService {
|
||||
await _confirmAndRestore(context, backup);
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
// Saved password failed, will prompt for manual input
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to restore with saved password, will prompt for manual input', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,8 @@ class NetSpeed extends TimeSeq<NetSpeedPart> {
|
||||
final bytesIn = BigInt.parse(bytes.first);
|
||||
final bytesOut = BigInt.parse(bytes[8]);
|
||||
results.add(NetSpeedPart(device, bytesIn, bytesOut, time));
|
||||
} catch (_) {
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to parse net speed data: $item', e, s);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -679,7 +679,7 @@ void _parseWindowsTemperatures(Temperatures temps, String raw) {
|
||||
if (typeLines.isNotEmpty && valueLines.isNotEmpty) {
|
||||
temps.parse(typeLines.join('\n'), valueLines.join('\n'));
|
||||
}
|
||||
} catch (e) {
|
||||
// If JSON parsing fails, ignore temperature data
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to parse Windows temperature data', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ class SftpReq {
|
||||
}
|
||||
try {
|
||||
knownHostFingerprints = Map<String, String>.from(Stores.setting.sshKnownHostFingerprints.get());
|
||||
} catch (_) {
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Failed to load SSH known host fingerprints', e, s);
|
||||
knownHostFingerprints = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user