user6733: Is this even possible?
traceIfFalse  ("A"++show(scriptContextTxInfo)) FoundIt

As logging onchain is just possible with this traceIfFalse ... I'm not finding a solution to make that line work

user1940: What I've done to debug Integers is to write a function that converts them into a BuiltinByteString and then decodeUtf8 it into a BuiltinString which is passed to any of the available trace functions.
I assume it could work for more complex data as well, but I have not tried that yet.
Example of what I described above:
{-# INLINABLE intBS #-}
intBS :: Integer -> BuiltinByteString
intBS i
  | i < 10    = consByteString (48 + i) emptyByteString
  | otherwise = appendByteString (intBS (divide i 10)) (intBS (modulo i 10))


-- ...
    traceIfFalse (decodeUtf8 $ intBS coolInt) $ ...
--...

Hope this helps.

user5926: This is probably not possible as the redeemer code is manipulated/examined from within a template haskell splice and you are running into what is called the "template haskell stage restriction".

6733: <p>Is this even possible?</p>
<pre><code>traceIfFalse  (&quot;A&quot;++show(scriptContextTxInfo)) FoundIt
</code></pre>
<p>As logging onchain is just possible with this traceIfFalse ... I'm not finding a solution to make that line work</p>
 1940: <p>What I've done to debug <code>Integer</code>s is to write a function that converts them into a <code>BuiltinByteString</code> and then decodeUtf8 it into a <code>BuiltinString</code> which is passed to any of the available <code>trace</code> functions.</p>
<p>I assume it could work for more complex data as well, but I have not tried that yet.</p>
<p>Example of what I described above:</p>
<pre><code>{-# INLINABLE intBS #-}
intBS :: Integer -&gt; BuiltinByteString
intBS i
  | i &lt; 10    = consByteString (48 + i) emptyByteString
  | otherwise = appendByteString (intBS (divide i 10)) (intBS (modulo i 10))


-- ...
    traceIfFalse (decodeUtf8 $ intBS coolInt) $ ...
--...
</code></pre>
<p>Hope this helps.</p>
 5926: <p>This is probably not possible as the redeemer code is manipulated/examined from within a template haskell splice and you are running into what is called the &quot;template haskell stage restriction&quot;.</p>
