Update logging
This commit is contained in:
@@ -27,6 +27,10 @@ class CoreFacadeImpl with ExceptionHandler, InfraLogger implements CoreFacade {
|
||||
return exceptionHandler(
|
||||
() {
|
||||
loggy.debug("setting up singbox");
|
||||
loggy.debug("base dir: ${filesEditor.baseDir.path}");
|
||||
loggy.debug("working dir: ${filesEditor.workingDir.path}");
|
||||
loggy.debug("temp dir: ${filesEditor.tempDir.path}");
|
||||
|
||||
return singbox
|
||||
.setup(
|
||||
filesEditor.baseDir.path,
|
||||
|
||||
@@ -84,7 +84,10 @@ class ProfilesRepositoryImpl
|
||||
)
|
||||
.run();
|
||||
},
|
||||
ProfileUnexpectedFailure.new,
|
||||
(error, stackTrace) {
|
||||
loggy.warning("error adding profile by url", error, stackTrace);
|
||||
return ProfileUnexpectedFailure(error, stackTrace);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -107,7 +110,10 @@ class ProfilesRepositoryImpl
|
||||
)
|
||||
.run();
|
||||
},
|
||||
ProfileUnexpectedFailure.new,
|
||||
(error, stackTrace) {
|
||||
loggy.warning("error adding profile", error, stackTrace);
|
||||
return ProfileUnexpectedFailure(error, stackTrace);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -115,6 +121,9 @@ class ProfilesRepositoryImpl
|
||||
TaskEither<ProfileFailure, Unit> update(Profile baseProfile) {
|
||||
return exceptionHandler(
|
||||
() async {
|
||||
loggy.debug(
|
||||
"updating profile [${baseProfile.name} (${baseProfile.id})]",
|
||||
);
|
||||
return fetch(baseProfile.url, baseProfile.id)
|
||||
.flatMap(
|
||||
(remoteProfile) => TaskEither(() async {
|
||||
@@ -130,7 +139,10 @@ class ProfilesRepositoryImpl
|
||||
)
|
||||
.run();
|
||||
},
|
||||
ProfileUnexpectedFailure.new,
|
||||
(error, stackTrace) {
|
||||
loggy.warning("error updating profile", error, stackTrace);
|
||||
return ProfileUnexpectedFailure(error, stackTrace);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -170,6 +182,7 @@ class ProfilesRepositoryImpl
|
||||
return parseResult.fold(
|
||||
(l) async {
|
||||
await File(path).delete();
|
||||
loggy.warning("error parsing config: $l");
|
||||
return left(ProfileFailure.invalidConfig(l.msg));
|
||||
},
|
||||
(_) {
|
||||
|
||||
Reference in New Issue
Block a user