Open jxsl13 opened 9 months ago
As a fellow log parser I like it. But the line feels a bit long :c
One could shorten the prefix to something like player entered
or client entered
. but In wanted to keep it as backwards compatible as possible.
Yea the just appending stuff at the end is convenient. While at it to change the log format and setting something new that we would want to stay backwards compatible to. How about we make it safer to parse. As in introduce proper escaping or encoding. What if someone uses the name foo'bar
and the clan ' country=
then it shows up as
player has entered the game. ClientID=0 addr=<{127.0.0.1}> sixup=1 version=0 name='foo'bar' clan='' country=' country=0
it does not matter for a decent regex implementation. They are (usually) greedy trying to find the longest (sub)match.
Example: https://regex101.com/r/zNPepP/2
Okay LGTM. I the chilled dragon :dragon: do hereby approve this RFC. :rocket: :heavy_check_mark:
I don't see clan and country to be all that useful as these can change without log message. Name would be nice though.
There are two purposes that one might want have for that:
The first purpose is to attach an econ or log parser that is able to replicate the whole state of the server by parsing logs and allowing to visualize the state easily with languages other than C++ with e.g. a website or a discord bot, without having to poll master servers. Posting a gameover statboard in the context of ddnet-insta would be such a use case (even tho the current approach is different but ddnet-insta may not be the last pvp mod that's based on ddnet and has a statboard). Every possible information would be necessary for this as well as a log line for every state transition.
My (current) primary use case for this log line is primarily hooking into certain event log lines like
Some of those are just thoughts that might become a use case but for now it's just all of the stuff related to moderation and not necessarily trivia bots and so on.
The first purpose is to attach an econ or log parser that is able to replicate the whole state of the server by parsing logs and allowing to visualize the state easily with languages other than C++ with e.g. a website or a discord bot, without having to poll master servers.
Starting to support that sounds like a pain, especially since log message changes now become breaking…
that's not my main purpose but yeah, that'd be a complete logging rework, preferrably with unique keywords describing state transitions. it's out of scope of this issue, I'd say.
player has entered the game. ClientID=%d addr=<{%s}> sixup=%d version=%d name='%s' clan='%s'
bump
https://github.com/ddnet/ddnet/blob/9a8541648c33f1879fbc7fc9b9f1e825bed6a591/src/engine/server/server.cpp#L1675
would be great if this log line was changed to contain as much player information as possible in order to reproduce the current server state by parsing logs / Econ.
https://github.com/teeworlds/teeworlds/issues/2475#issuecomment-944926682
reference log line
example how the ddnet log line could look like: