({{, (RefLink[EchoFunction, paclet:ref/EchoFunction])[f][expr] 
prints f[expr] and returns expr.}, {, (RefLink[EchoFunction, paclet:ref/EchoFunction])[label,f][expr]
prints f[expr], prepending label, and returns expr.}})

OpenersNotesSection(Spacer1)Details

(RefLink[EchoFunction, paclet:ref/EchoFunction]) is the operator form of (RefLink[Echo, paclet:ref/Echo]).

(RefLink[EchoFunction, paclet:ref/EchoFunction])[][expr] prints expr and returns expr. It is equivalent to (RefLink[Echo, paclet:ref/Echo])[expr].

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Print a property of an intermediate result:

expr1;EchoFunction[Length][DateList[]];expr2

Report a property using a label:

expr1;EchoFunction["length: ",Length][DateList[]];expr2

OpenersExampleSection2(Spacer1)Applications  (1)

Report timings of intermediate evaluations:

EchoFunction[AbsoluteTiming][Unevaluated[Pause[1];foo]];bar

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

(RefLink[EchoFunction, paclet:ref/EchoFunction]) is the operator form of (RefLink[Echo, paclet:ref/Echo]):

Echo[expr,"label: ",f]

EchoFunction["label: ",f][expr]

(RefLink[Echo, paclet:ref/Echo]) gives priority to the label, and (RefLink[EchoFunction, paclet:ref/EchoFunction]) gives priority to the function:

Echo[expr,"label: "]

EchoFunction[f][expr]

These cases are equivalent:

Echo[expr]

EchoFunction[][expr]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Echo, paclet:ref/Echo])  ▪  (RefLink[Print, paclet:ref/Print])  ▪  (RefLink[TracePrint, paclet:ref/TracePrint])  ▪  (RefLink[Sow, paclet:ref/Sow])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Tuning & Debugging, paclet:guide/TuningAndDebugging])}, {▪(RefLinkPlain[Basic Input & Output in Programs, paclet:guide/BasicInputAndOutputInPrograms])}})}})