diff --git a/lib/SLUB/LZA/Rosetta/TA/Command/log.pm b/lib/SLUB/LZA/Rosetta/TA/Command/log.pm index 4a473c35fd0babc6af76197922155952d248841f..de41f940d0f7b206c042ae789abf9970df67ab03 100644 --- a/lib/SLUB/LZA/Rosetta/TA/Command/log.pm +++ b/lib/SLUB/LZA/Rosetta/TA/Command/log.pm @@ -22,6 +22,8 @@ Examples: $0 log --level error --level warning --fromdate 2022-01-01 --todate 2021-02-01 * Are there lines with regex "ma[tc]?h"? $0 log --match "ma[tc]?h" + * Give me a trace of specific sip + $0 log --trace-sip sip293144 DESCR sub description { @@ -40,6 +42,7 @@ sub opt_spec { ["todate=s" => "search ending with date"], ["level=s@" => "levels to search for. Levels could be: 'error', 'warn', 'info', 'debug'. You could use multiple levels by repeating"], ["match=s" => "perl regex to search for" => {default=>".*"}], + ["trace-sip=s" => "trace a sip with given ID (SIP-ID or Deposit-ID)"], ); } @@ -179,7 +182,14 @@ sub execute { } elsif (defined $opt->csv) { $output_filter = sub { csv($_[0], $opt, $match_rx); }; } - SLUB::LZA::Rosetta::TA::scan_log($date_rx, $level_rx, $match_rx, $output_filter); + # prepare trace + my $with_trace; + if (defined $opt->trace_sip) { + $with_trace = $opt->trace_sip; + SLUB::LZA::Rosetta::TA::trace_log($with_trace); + } else { + SLUB::LZA::Rosetta::TA::scan_log($date_rx, $level_rx, $match_rx, $output_filter, $with_trace); + } } 1; \ No newline at end of file