Skip to content
Snippets Groups Projects
Commit f9828c38 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added option "--trace-sip"

parent 5e15a5ed
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,8 @@ Examples: ...@@ -22,6 +22,8 @@ Examples:
$0 log --level error --level warning --fromdate 2022-01-01 --todate 2021-02-01 $0 log --level error --level warning --fromdate 2022-01-01 --todate 2021-02-01
* Are there lines with regex "ma[tc]?h"? * Are there lines with regex "ma[tc]?h"?
$0 log --match "ma[tc]?h" $0 log --match "ma[tc]?h"
* Give me a trace of specific sip
$0 log --trace-sip sip293144
DESCR DESCR
sub description { sub description {
...@@ -40,6 +42,7 @@ sub opt_spec { ...@@ -40,6 +42,7 @@ sub opt_spec {
["todate=s" => "search ending with date"], ["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"], ["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=>".*"}], ["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 { ...@@ -179,7 +182,14 @@ sub execute {
} elsif (defined $opt->csv) { } elsif (defined $opt->csv) {
$output_filter = sub { csv($_[0], $opt, $match_rx); }; $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; 1;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment