Skip to content

Commit 5377327

Browse files
author
Tim Watson
committed
document 'trace' primitive for use by users
1 parent b49566a commit 5377327

File tree

1 file changed

+7
-0
lines changed
  • distributed-process/src/Control/Distributed/Process/Internal

1 file changed

+7
-0
lines changed

distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,13 @@ reconnectPort them = do
899899
-- Debugging/Tracing --
900900
--------------------------------------------------------------------------------
901901

902+
-- | Send a message to the internal (system) trace facility. If tracing is
903+
-- enabled, this will create a custom trace event in the event log. Specifically,
904+
-- the environment variable @DISTRIBUTED_PROCESS_TRACE_FILE@ is set to a valid
905+
-- path, then trace output will be written to that file. Otherwise, if the GHC
906+
-- eventlog is enabled (i.e., you've compiled with @-eventlog@ set) and the
907+
-- relevant @+RTS@ options given, then the message will be sent to the event log.
908+
-- If neither facility is in use then trace messages will be silently dropped.
902909
trace :: String -> Process ()
903910
trace s = do
904911
node <- processNode <$> ask

0 commit comments

Comments
 (0)