Handbook
Glossary
analyze-log-file ( service word-names -- )
Vocabulary
logging
.
analysis
Inputs
service
a log service name
word-names
a 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
USING:
io
io.files
kernel
logging.parser
logging.server
math
namespaces
prettyprint
;
IN:
logging.analysis
::
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
;