Debug.Trace
模块具有traceEvent
功能,可向事件日志发送消息。最近,添加了traceMarker
函数,它似乎做了同样的事情。例如,采用以下程序:
module Main where
import Debug.Trace
main :: IO ()
main = do
traceEventIO "This is an event"
traceMarkerIO "This is a marker"
使用-debug -w -eventlog -rtsopts
编译并使用+RTS -vu
执行,它在事件日志中显示以下内容:
...
cap 0: running thread 1 (ThreadRunGHC)
cap 0: This is an event
cap 0: User marker: This is a marker
cap 0: thread 1 stopped (finished)
cap 0: created thread 2
...
何时使用traceEvent
以及何时使用traceMarker
?