diff --git a/lib/Cro.pm6 b/lib/Cro.pm6 index ccd3d62..4acb4a0 100644 --- a/lib/Cro.pm6 +++ b/lib/Cro.pm6 @@ -374,21 +374,23 @@ class Cro::PipelineTraceTransform does Cro::Transform { supply { whenever $in -> \msg { my $output = (try msg.trace-output) // msg.perl; - note "[TRACE($!label)] $!component.^name() EMIT {encode $output}"; - $*ERR.flush; + self!output-trace: "EMIT {encode $output}"; emit msg; LAST { - note "[TRACE($!label)] $!component.^name() DONE"; - $*ERR.flush; + self!output-trace: "DONE"; } QUIT { - note "[TRACE($!label)] $!component.^name() QUIT {encode .gist}"; - $*ERR.flush; + self!output-trace: "QUIT {encode .gist}"; } } } } + method !output-trace($message --> Nil) { + note "[TRACE($!label)] $!component.^name() $message"; + $*ERR.flush; + } + my $encode = ?%*ENV; sub encode(Str $_) { $encode