Skip to content

Commit 9fb3521

Browse files
committed
Document trace/trace.force
1 parent 83e6ad4 commit 9fb3521

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

compiler/src/dotty/tools/dotc/reporting/trace.scala

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ import config.Config
77
import config.Printers
88
import core.Mode
99

10+
/** Exposes the {{{ trace("question") { op } }}} syntax.
11+
*
12+
* Traced operations will print indented messages if enabled.
13+
* Tracing depends on [[Config.tracingEnabled]] and [[dotty.tools.dotc.config.ScalaSettings.Ylog]].
14+
* Tracing can be forced by replacing [[trace]] with [[trace.force]] (see below).
15+
*/
16+
object trace extends TraceSyntax {
17+
final val isForced = false
18+
19+
/** Forces a particular trace to be printed out regardless of tracing being enabled. */
20+
object force extends TraceSyntax {
21+
final val isForced = true
22+
}
23+
}
24+
1025
abstract class TraceSyntax {
1126
val isForced: Boolean
1227

@@ -101,10 +116,3 @@ abstract class TraceSyntax {
101116
}
102117
}
103118
}
104-
105-
object trace extends TraceSyntax {
106-
final val isForced = false
107-
object force extends TraceSyntax {
108-
final val isForced = true
109-
}
110-
}

0 commit comments

Comments
 (0)