mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 14:23:42 +00:00
feat: add logger
This commit is contained in:
1 parent
5073ae6166
commit
b0a7a5569a
9 files changed
+31
-8
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
import 'request.dart';
|
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
import 'request.dart';
|
||||||
|
|
||||||
part 'resource.g.dart';
|
part 'resource.g.dart';
|
||||||
|
|
||||||
@JsonSerializable(explicitToJson: true)
|
@JsonSerializable(explicitToJson: true)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
import 'options.dart';
|
import 'options.dart';
|
||||||
import 'resource.dart';
|
import 'resource.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
|
||||||
|
|
||||||
part 'task.g.dart';
|
part 'task.g.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,18 @@ import 'core/libgopeed_boot.dart';
|
|||||||
import 'routes/router.dart';
|
import 'routes/router.dart';
|
||||||
import 'setting/setting.dart';
|
import 'setting/setting.dart';
|
||||||
import 'theme/theme.dart';
|
import 'theme/theme.dart';
|
||||||
|
import 'util/log_util.dart';
|
||||||
import 'util/mac_secure_util.dart';
|
import 'util/mac_secure_util.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
await LibgopeedBoot.instance.start();
|
try {
|
||||||
await Setting.instance.load();
|
await LibgopeedBoot.instance.start();
|
||||||
|
await Setting.instance.load();
|
||||||
|
} catch (e) {
|
||||||
|
logger.e("init fail", e);
|
||||||
|
}
|
||||||
MacSecureUtil.loadBookmark();
|
MacSecureUtil.loadBookmark();
|
||||||
|
|
||||||
runApp(GetMaterialApp.router(
|
runApp(GetMaterialApp.router(
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:gopeed/api/api.dart';
|
import 'package:gopeed/api/api.dart';
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:gopeed/api/api.dart';
|
|
||||||
import 'package:gopeed/api/model/server_config.dart';
|
|
||||||
|
|
||||||
import '../../setting/setting.dart';
|
import '../../setting/setting.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:gopeed/api/api.dart';
|
|||||||
import 'package:gopeed/api/model/task.dart';
|
import 'package:gopeed/api/model/task.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../util/util.dart';
|
import '../../util/util.dart';
|
||||||
import 'task_controller.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"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.0.0"
|
||||||
|
logger:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: logger
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
logging:
|
logging:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ dependencies:
|
|||||||
shared_preferences: ^2.0.15
|
shared_preferences: ^2.0.15
|
||||||
permission_handler: ^10.1.0
|
permission_handler: ^10.1.0
|
||||||
external_path: ^1.0.3
|
external_path: ^1.0.3
|
||||||
|
logger: ^1.1.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in new issue
Block a user