Skip to content

Commit

Permalink
bin.rs NFC debug print syslogprocessor stages more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmoon79 committed Sep 18, 2023
1 parent b0f7f10 commit 9bfb3ca
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/bin/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1674,19 +1674,22 @@ fn exec_syslogprocessor(
return;
}
};
defo!("syslogproc {:?}", syslogproc);
deo!("{:?}({}): syslogproc {:?}", _tid, _tname, syslogproc);

// send `ChanDatum::FileInfo`
let result = syslogproc.process_stage0_valid_file_check();
let mtime = syslogproc.mtime();
let dt = systemtime_to_datetime(&tz_offset, &mtime);
match chan_send_dt.send(ChanDatum::FileInfo(DateTimeLOpt::Some(dt), result)
match chan_send_dt.send(
ChanDatum::FileInfo(DateTimeLOpt::Some(dt), result)
) {
Ok(_) => {}
Err(err) =>
e_err!("A chan_send_dt.send(…) failed {} for {:?}", err, path)
}

deo!("{:?}({}): processing stage 1", _tid, _tname);

let result = syslogproc.process_stage1_blockzero_analysis();
match result {
FileProcessingResultBlockZero::FileOk => {}
Expand All @@ -1699,11 +1702,13 @@ fn exec_syslogprocessor(
),
&path
);
defx!("({:?}) return early due to error", path);
defx!("({:?}) return during stage 1 due to error", path);
return;
}
}

deo!("{:?}({}): processing stage 2", _tid, _tname);

// find first sysline acceptable to the passed filters
match syslogproc.process_stage2_find_dt(&filter_dt_after_opt) {
FileProcessingResultBlockZero::FileOk => {}
Expand All @@ -1716,7 +1721,7 @@ fn exec_syslogprocessor(
),
&path
);
defx!("({:?}) return early during stage2", path);
defx!("({:?}) return during stage 2, no datetime within filters", path);
return;
}
}
Expand Down Expand Up @@ -1763,7 +1768,7 @@ fn exec_syslogprocessor(
}

if !search_more {
deo!("{:?}({}): quit searching", _tid, _tname);
deo!("{:?}({}): last line so quit searching", _tid, _tname);
let summary_opt: SummaryOpt = Some(syslogproc.process_stage4_summary());
chan_send(
&chan_send_dt,
Expand All @@ -1773,11 +1778,13 @@ fn exec_syslogprocessor(
),
&path
);
defx!("({:?}) return early, no more searching to do", path);
defx!("({:?}) return early during stage 2, at last line so no more searching to do", path);

return;
}

deo!("{:?}({}): processing stage 3", _tid, _tname);

// find all proceeding syslines acceptable to the passed filters
syslogproc.process_stage3_stream_syslines();

Expand Down Expand Up @@ -1830,6 +1837,8 @@ fn exec_syslogprocessor(
}
}

deo!("{:?}({}): processing stage 4", _tid, _tname);

syslogproc.process_stage4_summary();

let summary = syslogproc.summary_complete();
Expand Down

0 comments on commit 9bfb3ca

Please sign in to comment.