Support core status check and force restart Optimize proxies page and access page Update flutter and pub dependencies Update go version Optimize more details
29 lines
662 B
Dart
29 lines
662 B
Dart
import 'package:fl_clash/enum/enum.dart';
|
|
import 'package:fl_clash/models/models.dart';
|
|
import 'package:fl_clash/state.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
class CommonPrint {
|
|
static CommonPrint? _instance;
|
|
|
|
CommonPrint._internal();
|
|
|
|
factory CommonPrint() {
|
|
_instance ??= CommonPrint._internal();
|
|
return _instance!;
|
|
}
|
|
|
|
void log(String? text, {LogLevel logLevel = LogLevel.info}) {
|
|
final payload = '[APP] $text';
|
|
debugPrint(payload);
|
|
if (!globalState.isInit) {
|
|
return;
|
|
}
|
|
globalState.appController.addLog(
|
|
Log.app(payload).copyWith(logLevel: logLevel),
|
|
);
|
|
}
|
|
}
|
|
|
|
final commonPrint = CommonPrint();
|