summary refs log tree commit diff
path: root/lib/debug.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2016-06-26 01:28:06 +0200
committerProfpatsch <mail@profpatsch.de>2016-06-26 02:04:58 +0200
commit6889f53397edf4c2e94df67d72ef0b1e7b18d35a (patch)
tree59a88298c4808206d951385806056dffaf84204d /lib/debug.nix
parent9ef6dceca9c050c1b2477d6d7b28921afe06df2e (diff)
downloadnixpkgs-6889f53397edf4c2e94df67d72ef0b1e7b18d35a.tar
nixpkgs-6889f53397edf4c2e94df67d72ef0b1e7b18d35a.tar.gz
nixpkgs-6889f53397edf4c2e94df67d72ef0b1e7b18d35a.tar.bz2
nixpkgs-6889f53397edf4c2e94df67d72ef0b1e7b18d35a.tar.lz
nixpkgs-6889f53397edf4c2e94df67d72ef0b1e7b18d35a.tar.xz
nixpkgs-6889f53397edf4c2e94df67d72ef0b1e7b18d35a.tar.zst
nixpkgs-6889f53397edf4c2e94df67d72ef0b1e7b18d35a.zip
debug.nix: add traceSeq & traceValSeq
Debugging functions that strictly deep-evaluate the argument that should
be traced.
Diffstat (limited to 'lib/debug.nix')
-rw-r--r--lib/debug.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/debug.nix b/lib/debug.nix
index 2d10d981114..38612d630b3 100644
--- a/lib/debug.nix
+++ b/lib/debug.nix
@@ -19,6 +19,10 @@ rec {
   traceXMLVal = x: trace (builtins.toXML x) x;
   traceXMLValMarked = str: x: trace (str + builtins.toXML x) x;
 
+  # strict trace functions (traced structure is fully evaluated and printed)
+  traceSeq = x: y: trace (builtins.deepSeq x x) y;
+  traceValSeq = v: traceVal (builtins.deepSeq v v);
+
   # this can help debug your code as well - designed to not produce thousands of lines
   traceShowVal = x : trace (showVal x) x;
   traceShowValMarked = str: x: trace (str + showVal x) x;