mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-06 16:40:32 +00:00
feat: add logger
This commit is contained in:
1 parent
5073ae6166
commit
b0a7a5569a
9 files changed
+32
-9
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import 'request.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'request.dart';
|
||||
|
||||
part 'resource.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'options.dart';
|
||||
import 'resource.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'task.g.dart';
|
||||
|
||||
|
||||
@@ -5,13 +5,18 @@ import 'core/libgopeed_boot.dart';
|
||||
import 'routes/router.dart';
|
||||
import 'setting/setting.dart';
|
||||
import 'theme/theme.dart';
|
||||
import 'util/log_util.dart';
|
||||
import 'util/mac_secure_util.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await LibgopeedBoot.instance.start();
|
||||
await Setting.instance.load();
|
||||
try {
|
||||
await LibgopeedBoot.instance.start();
|
||||
await Setting.instance.load();
|
||||
} catch (e) {
|
||||
logger.e("init fail", e);
|
||||
}
|
||||
MacSecureUtil.loadBookmark();
|
||||
|
||||
runApp(GetMaterialApp.router(
|
||||
@@ -21,4 +26,4 @@ void main() async {
|
||||
themeMode: Setting.instance.themeMode,
|
||||
getPages: Routes.routes,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gopeed/api/api.dart';
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gopeed/api/api.dart';
|
||||
import 'package:gopeed/api/model/server_config.dart';
|
||||
|
||||
import '../../setting/setting.dart';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:gopeed/api/api.dart';
|
||||
import 'package:gopeed/api/model/task.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../util/util.dart';
|
||||
import 'task_controller.dart';
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:logger/logger.dart';
|
||||
import 'package:logger/src/outputs/file_output.dart';
|
||||
|
||||
import 'util.dart';
|
||||
|
||||
final logger = Logger(
|
||||
printer: PrettyPrinter(),
|
||||
output: Util.isDesktop() ? FileOutput(file: File('log.txt')) : null,
|
||||
);
|
||||
@@ -401,6 +401,13 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
logger:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: logger
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -48,6 +48,7 @@ dependencies:
|
||||
shared_preferences: ^2.0.15
|
||||
permission_handler: ^10.1.0
|
||||
external_path: ^1.0.3
|
||||
logger: ^1.1.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in new issue
Block a user