Skip to content

Commit e93f435

Browse files
authored
Contribute functionality that helps debugging (#2203)
1 parent d786046 commit e93f435

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

bin/dartdoc.dart

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ Future<void> main(List<String> arguments) async {
9898
}, onError: (e, Chain chain) {
9999
if (e is DartdocFailure) {
100100
stderr.writeln('\ndartdoc failed: ${e}.');
101+
if (config.verboseWarnings) {
102+
stderr.writeln(chain.terse);
103+
}
101104
exitCode = 1;
102105
return;
103106
} else {

lib/src/model/package_graph.dart

+14-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,20 @@ class PackageGraph {
650650
}
651651

652652
@override
653-
String toString() => 'PackageGraph built from ${defaultPackage.name}';
653+
String toString() {
654+
final divider = '=========================================================';
655+
final buffer =
656+
StringBuffer('PackageGraph built from ${defaultPackage.name}');
657+
buffer.writeln(divider);
658+
buffer.writeln();
659+
for (final name in packageMap.keys) {
660+
final package = packageMap[name];
661+
buffer.writeln('Package $name documented at ${package.documentedWhere} '
662+
'with libraries: ${package.allLibraries}');
663+
}
664+
buffer.writeln(divider);
665+
return buffer.toString();
666+
}
654667

655668
final Map<Element, Library> _canonicalLibraryFor = {};
656669

0 commit comments

Comments
 (0)