Skip to content

Commit

Permalink
Add toString implementations to Driver and Lookup for easier debugging.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 539736928
Change-Id: Ib44d22ed8e1e21463f594c880f214d4c46a73b36
  • Loading branch information
aoeui authored and copybara-github committed Jun 12, 2023
1 parent 1f18b19 commit d243c04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/google/devtools/build/skyframe/state/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.
package com.google.devtools.build.skyframe.state;

import static com.google.common.base.MoreObjects.toStringHelper;

import com.google.common.collect.Lists;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
Expand Down Expand Up @@ -126,4 +127,13 @@ void addReady(TaskTreeNode task) {
void addLookup(Lookup lookup) {
newlyAdded.add(lookup);
}

@Override
public String toString() {
return toStringHelper(this)
.add("ready", ready)
.add("newlyAdded", newlyAdded)
.add("pending", pending)
.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
package com.google.devtools.build.skyframe.state;

import static com.google.common.base.MoreObjects.toStringHelper;

import com.google.devtools.build.skyframe.SkyFunction.LookupEnvironment;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
Expand Down Expand Up @@ -265,4 +267,9 @@ boolean tryHandleException(Exception exception) {
return false;
}
}

@Override
public String toString() {
return toStringHelper(this).add("parent", parent).add("key", key).toString();
}
}

0 comments on commit d243c04

Please sign in to comment.