mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 15:53:47 +08:00
29 lines
516 B
Dart
29 lines
516 B
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:synchronized/synchronized.dart';
|
|
|
|
export 'package:starcitizen_doctor/generated/l10n.dart';
|
|
|
|
var _logLock = Lock();
|
|
File? _logFile;
|
|
|
|
void dPrint(src) async {
|
|
if (kDebugMode) {
|
|
print(src);
|
|
}
|
|
try {
|
|
await _logLock.synchronized(() async {
|
|
_logFile?.writeAsString("$src\n", mode: FileMode.append);
|
|
});
|
|
} catch (_) {}
|
|
}
|
|
|
|
void setDPrintFile(File file) {
|
|
_logFile = file;
|
|
}
|
|
|
|
File? getDPrintFile() {
|
|
return _logFile;
|
|
}
|