user989: Since I just started to write Plutus code, I want to make some tests of Plutus.
For example, I'd like to know what exactly my redeemer :: BuiltinData value is. However I can't convert BuiltinData to BuiltinString which means I can't use trace :: BuiltinString -> a -> a to log it.
Is it possible to convert BuiltinData to BuiltinString or there is different approach to log redeemer?

user255: Since BuiltinData derives Show:
newtype BuiltinData = BuiltinData PLC.Data
    deriving newtype (Show, Eq, Ord)

and there's the function:
stringToBuiltinString :: String -> BuiltinString found here in PlutusTx/Builtins/Class.hs
Assuming your "variable name" is dummyBuiltinData, you can convert BuiltinData to BuiltinString using:
stringToBuiltinString $ show dummyBuiltinData
EDIT:
As noted by kolam, show isn't INLINABLE and isn't applicable on-chain. Here is a version that should work:
decodeUtf8 $ unsafeDataAsB dummyBuiltinData
both decodeUtf8 and unsafeDataAsB can be found in module PlutusTx.Builtins.Internal

989: <p>Since I just started to write Plutus code, I want to make some tests of Plutus.</p>
<p>For example, I'd like to know what exactly my <code>redeemer :: BuiltinData</code> value is. However I can't convert BuiltinData to BuiltinString which means I can't use <code>trace :: BuiltinString -&gt; a -&gt; a</code> to log it.</p>
<p>Is it possible to convert BuiltinData to BuiltinString or there is different approach to log redeemer?</p>
 255: <p>Since <code>BuiltinData</code> derives <code>Show</code>:</p>
<pre><code>newtype BuiltinData = BuiltinData PLC.Data
    deriving newtype (Show, Eq, Ord)
</code></pre>
<p>and there's the function:</p>
<p><code>stringToBuiltinString :: String -&gt; BuiltinString</code> found here in <code>PlutusTx/Builtins/Class.hs</code></p>
<p>Assuming your &quot;variable name&quot; is <code>dummyBuiltinData</code>, you can convert <code>BuiltinData</code> to <code>BuiltinString</code> using:</p>
<p><code>stringToBuiltinString $ show dummyBuiltinData</code></p>
<p>EDIT:</p>
<p>As noted by <a href="https://cardano.stackexchange.com/users/2681/kolam">kolam</a>, <code>show</code> isn't <code>INLINABLE</code> and isn't applicable on-chain. Here is a version that should work:</p>
<p><code>decodeUtf8 $ unsafeDataAsB dummyBuiltinData</code></p>
<p>both <code>decodeUtf8</code> and <code>unsafeDataAsB</code> can be found in module <code>PlutusTx.Builtins.Internal</code></p>
