In Haskell, you put it in the pipeline: for instance,
y = h (f (traceShowId (g x)))
(Haskell is normally pure, but these functions from Debug.Trace are a notable exception.)