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:
GT610
2026-01-07 15:09:22 +08:00
committed by GitHub
parent cc300c141a
commit 2c495a44c3
36 changed files with 114 additions and 41 deletions

View File

@@ -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;
}
}

View File

@@ -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);
}
}