Robert Zehnder
12/28/2022, 9:13 PMprint
from inside models/services. Currently, if I want to print to the console from a service, I am passing in an instance of print
as an argument to my service method.bdw429s
12/28/2022, 9:21 PMbdw429s
12/28/2022, 9:24 PMbdw429s
12/28/2022, 9:25 PMjob.start( 'This is my job to run' );
job.addLog( 'Still going...' );
job.addLog( 'Now we''re getting somewhere.' );
job.addLog( 'Almost done!' );;
job.complete();
bdw429s
12/28/2022, 9:25 PMprintbuffer.line().toConsole()
method as it will flush immediatleybdw429s
12/28/2022, 9:26 PMRobert Zehnder
12/28/2022, 9:27 PMbdw429s
12/28/2022, 9:27 PMRobert Zehnder
12/28/2022, 9:29 PMprint
as an argument works, just didnt feel rightbdw429s
12/28/2022, 9:32 PMsystemOutput( myVar, true )
Robert Zehnder
12/28/2022, 9:32 PMbdw429s
12/28/2022, 9:32 PMRobert Zehnder
12/28/2022, 9:32 PMbdw429s
12/28/2022, 9:33 PMbdw429s
12/28/2022, 9:33 PMSystem.out
Robert Zehnder
12/28/2022, 9:34 PMbdw429s
12/28/2022, 9:34 PMdump( var=myVar, output="console" )
but
• the formatting is crap
• it's annoying to typebdw429s
12/28/2022, 9:37 PMSilly question, but do you know the wirebox injection for the print buffer?Because that's the name of the CFC in the
system/util
directory
https://s3.amazonaws.com/apidocs.ortussolutions.com/commandbox-core/5.7.0/index.html?commandbox/system/util/package-summary.html
and all of those CFCs are directly mapped in WireBox in the CommandBox core
https://github.com/Ortus-Solutions/commandbox/blob/development/src/cfml/system/config/WireBox.cfc#L94bdw429s
12/28/2022, 9:37 PMinject name='print' injet='printBuffer';
jakobward
12/28/2022, 9:39 PMRobert Zehnder
12/28/2022, 9:39 PMRobert Zehnder
12/28/2022, 9:39 PMbdw429s
12/28/2022, 9:40 PMRobert Zehnder
12/28/2022, 9:44 PM