Replies: 2 comments 7 replies
-
There is something we could potentially use: https://docs.rs/log/latest/log/ |
Beta Was this translation helpful? Give feedback.
5 replies
-
@emwalker @blaumeise20 would it be interesting to implement this directly into the parser engine at the moment? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There are certain points in the engine where we need or want to log information back to a user. This could be warnings and errors during tokenizing/parsing data, or other information (for instance, when we query a hostname, and the dns is not found).
We should be able to have a central based log, where we can log these things into. Furthermore, things like the parser probably want to "duplicate" the logs so parsing of a document will result in a document/dom-tree and a separate log of all things that failed.
We could have a central logger that works a bit like syslog, and underwater passes it through different log mechanism like syslog, direct to file, or even post it directly over http for instance.
I don't have enough experience with rust to know if these kind of loggers are already available, or that we should create our own system. Note that i think it would make sense to have the logging be done outside the main thread: from the engine, we do a
log.log(Log::HTML5_PARSE, Log::WARN, "error while parsing something on line 1, colum 5")
, and this will return immediately while the actual storing of this into syslog, file, json, http, whereever is done in the background.Beta Was this translation helpful? Give feedback.
All reactions