diff --git a/lib/Zonemaster/CLI.pm b/lib/Zonemaster/CLI.pm index 2f026ee2..55a96545 100755 --- a/lib/Zonemaster/CLI.pm +++ b/lib/Zonemaster/CLI.pm @@ -437,16 +437,23 @@ sub run { # Don't do anything } else { - my $str = sprintf "%7.2f %-9s ", $entry->timestamp, $entry->level; + my $prefix = sprintf "%7.2f %-9s ", $entry->timestamp, $entry->level; if ( $self->show_module ) { - $str.= sprintf "%-12s ", $entry->module; + $prefix .= sprintf "%-12s ", $entry->module; } if ( $self->show_testcase ) { - $str.= sprintf "%-14s ", $entry->testcase; + $prefix .= sprintf "%-14s ", $entry->testcase; + } + $prefix .= $entry->tag; + + my $message = $entry->string; + $message =~ s/^[A-Z0-9:_]+//; # strip MODULE:TAG, they're coming in $prefix instead + my @lines = split /\n/, $message; + + printf "%s%s %s\n", $prefix, ' ', shift @lines; + for my $line ( @lines ) { + printf "%s%s %s\n", $prefix, '>', $line; } - my $entry_str = sprintf "%s", $entry->string; - $entry_str =~ s/^([A-Z0-9]+:)*//; - printf "%s%s\n", $str, $entry_str; } } ## end if ( $numeric{ uc $entry...}) if ( $self->stop_level and $numeric{ uc $entry->level } >= $numeric{ $self->stop_level } ) {