Improve finalizedTask log

This commit is contained in:
huangyuhui 2018-08-29 00:03:50 +08:00
parent ed3a04d531
commit 7c77c317df
3 changed files with 10 additions and 7 deletions

10
.gitignore vendored
View File

@ -4,7 +4,6 @@
hs_err_pid*
.gradle
.idea
*.lck
*.1
@ -19,7 +18,12 @@ NVIDIA
/HMCL/build/
/HMCLCore/build/
# idea output
# idea
.idea
/out/
/HMCL/out/
/HMCLCore/out/
/HMCLCore/out/
# eclipse
.classpath
.project

View File

@ -37,13 +37,13 @@ final class FinalizedTask extends Task {
* @param pred the task that runs before succ.
* @param callback a callback that returns the task runs after pred, succ will be executed asynchronously. You can do something that relies on the result of pred.
*/
public FinalizedTask(Task pred, Scheduler scheduler, FinalizedCallback callback) {
public FinalizedTask(Task pred, Scheduler scheduler, FinalizedCallback callback, String name) {
this.dependents = Collections.singleton(pred);
this.scheduler = scheduler;
this.callback = callback;
setSignificance(TaskSignificance.MODERATE);
setName(callback.toString());
setName(name);
}
@Override
@ -53,7 +53,6 @@ final class FinalizedTask extends Task {
@Override
public void execute() throws Exception {
setName(callback.toString());
callback.execute(getVariables(), isDependentsSucceeded());
if (!isDependentsSucceeded())

View File

@ -281,7 +281,7 @@ public abstract class Task {
}
public final Task finalized(Scheduler scheduler, FinalizedCallback b) {
return new FinalizedTask(this, scheduler, b);
return new FinalizedTask(this, scheduler, b, ReflectionHelper.getCaller().toString());
}
public final <T extends Exception, K extends Exception> Task finalized(Scheduler scheduler, ExceptionalConsumer<AutoTypingMap<String>, T> success, ExceptionalConsumer<Exception, K> failure) {