analyze-log-file ( service word-names -- )


Vocabulary
logging.analysis

Inputs
servicea log service name
word-namesa sequence of strings


Outputs
None

Word description
Prints a report for the active log file of a service. Reads at most log-report-limit bytes, so an accumulated backlog cannot make a report load the entire file into memory.

Definition


:: analyze-log-file ( service word-names -- )
service log-path 1 log# :> path path file-exists? [
path log-report-limit get log-file-tail
:> ( lines omitted ) omitted 0 > [
"Partial log report: omitted " write omitted pprint
" bytes from the beginning of the log; counts cover only the r..."
print nl
] when lines word-names analyze-log
] [ f word-names analyze-entries analysis. ] if ;