Open moleike opened 3 years ago
std.trace(str, rest) outputs the given string str to stderr and returns rest as the result.
std.trace(str, rest)
str
rest
Example:
local conditionalReturn(cond, in1, in2) = if (cond) then std.trace('cond is true returning ' + std.toString(in1), in1) else std.trace('cond is false returning ' + std.toString(in2), in2); { a: conditionalReturn(true, { b: true }, { c: false }), }
Prints:
TRACE: test.jsonnet:3 cond is true returning {"b": true} { "a": { "b": true } }
std.trace(str, rest)
outputs the given stringstr
to stderr and returnsrest
as the result.Example:
Prints: