<p>Your validator is basically <code>False || True</code>, which will always return <code>True</code>. The value from <code>traceIfFalse</code> is only passed to the user if the final result of the validator is False.</p>
<p>So if you are using the most recent version of cardano-cli the error should appear once you try to build a transaction removing the <code>|| True</code> part. If you want, however, to log an error even when the validation succeeds, this is impossible with Plutus, at least on-chain.</p>

CC BY-SA 4.0
2022-02-23T09:17:48.710Z
2022-02-23T09:17:48.710Z
Mateus
<p>I'm wondering how to log/print/trace any message during the execution of a contract when submitted to the blockchain via <code>cardano-cli</code>.
So basically I hoped this very simple test script would show me something:</p>
<pre><code>mkValidator :: ContractInfo -&gt; () -&gt; () -&gt; ScriptContext -&gt; Bool
mkValidator _ _ _ _ = (traceIfFalse &quot;Test&quot; False) || True
</code></pre>
<p>However, when submitting a transaction with this script to <code>cardano-cli</code>, it gets executed without printing anything.</p>

<plutus><plutus-pioneer-program><cardano-cli><smart-contract>
How to log/trace/print messages from within the contract ON-chain code, while using cardano-cli?
# How to log/trace/print messages from within the contract ON-chain code, while using cardano-cli?

(Asked by: username_0 on 2022-02-23)

I'm wondering how to log/print/trace any message during the execution of a contract when submitted to the blockchain via cardano-cli.
So basically I hoped this very simple test script would show me something:
mkValidator :: ContractInfo -> () -> () -> ScriptContext -> Bool
mkValidator _ _ _ _ = (traceIfFalse "Test" False) || True

However, when submitting a transaction with this script to cardano-cli, it gets executed without printing anything.

**Tags:** plutus, plutus-pioneer-program, cardano-cli, smart-contract

---

## 1 answers

### Answer by username_1 on 2022-02-23. Score: 1

Your validator is basically `False || True`, which will always return `True`. The value from `traceIfFalse` is only passed to the user if the final result of the validator is False.

So if you are using the most recent version of cardano-cli the error should appear once you try to build a transaction removing the `|| True` part. If you want, however, to log an error even when the validation succeeds, this is impossible with Plutus, at least on-chain.


---

