From 562286aa560aea85448adbc0e50e636e8d3cf8d0 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Mon, 2 Apr 2018 20:41:59 +0200 Subject: [PATCH] lib/debug: deprecate `traceValIfNot` The function is only used in exactly one module and overly specific (`c` must be a true predicate for `x`, if not, a specific trace is called). --- lib/debug.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/debug.nix b/lib/debug.nix index fad6b769b39..16e8710168c 100644 --- a/lib/debug.nix +++ b/lib/debug.nix @@ -93,9 +93,10 @@ rec { traceCall2 = n: f: a: b: let t = n2: x: traceShowValMarked "${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: traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b) (t "arg 3" c)); - # FIXME: rename this? traceValIfNot = c: x: - if c x then true else trace (showVal x) false; + trace ( "Warning: `traceValIfNot` is deprecated " + + "and will be removed in the next release." ) + (if c x then true else traceSeq (showVal x) false); /* Evaluate a set of tests. A test is an attribute set {expr, expected}, denoting an expression and its expected result. The