summary refs log tree commit diff
path: root/pkgs/lib/default.nix
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2008-12-02 12:26:05 +0000
committerMarc Weber <marco-oweber@gmx.de>2008-12-02 12:26:05 +0000
commit01fc783e7f2527e7f712ea8fd2965f829bb61a53 (patch)
tree6a25d0647678dd422b9cf7450c09fc1b0a97530a /pkgs/lib/default.nix
parent38cf2a4d7e734c34f317c5df43739510b5fa693b (diff)
added debug functions tracing function arguments and result
svn path=/nixpkgs/trunk/; revision=13540
Diffstat (limited to 'pkgs/lib/default.nix')
-rw-r--r--pkgs/lib/default.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix
index 0a8dc6623e533..fe5b7fb1427f4 100644
--- a/pkgs/lib/default.nix
+++ b/pkgs/lib/default.nix
@@ -577,6 +577,11 @@ rec {
       else if (x == false) then "x is boolean false"
       else if (x == null) then "x is null"
       else "x is probably a string starting, starting characters: ${__substring 0 50 x}..";
+  # trace the arguments passed to function and its result 
+  traceCall  = n : f : a : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a));
+  traceCall2 = n : f : a : b : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b));
+  traceCall3 = n : f : a : b : c : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b) (t "arg 3" c));
+
 
 
   innerClosePropagation = ready: list: if list == [] then ready else