Handbook
Glossary
parse-log ( lines -- entries )
Furnace framework
»
Logging framework
»
Log file parser
Vocabulary
logging
.
parser
Inputs
lines
a sequence of strings
Outputs
entries
a sequence of log entries
Word description
Parses a sequence of log entries. Malformed entries are printed out and ignore. The result is a sequence of arrays of the shape
{ timestamp level name>> message }
, where
•
timestamp
is a
timestamp
•
level
is a log level; see
Log levels
•
word-name
is a string
•
message
is a string
Definition
USING:
combinators
kernel
make
sequences
;
IN:
logging.parser
:
parse-log
( lines -- entries )
[
[
parse-log-line
{
{
[
dup
malformed?
]
[
malformed-line
]
}
{
[
dup
multiline?
]
[
add-multiline
]
}
[
,
]
}
cond
]
each
]
{
}
make
;