Age | Commit message (Collapse) | Author |
|
This is way shorter and serves the same purpose: It reflects the
responsibility of encoding and decoding XML. The encoderDecoder struct
should be removed soon.
|
|
LimoX does not care about these XML tokens at least for now. The issued
error messages on other levels.
Dropping those tokens on the encoderDecoder level asserts that the rest
of the xmpp code has only `clean` XML content to process.
|
|
The prefix has now more visual contrast to the XML content due to its
own bracket style.
Furthermore the indent for the TX stream was disabled. Indent is a nice
thing but it just makes sense if both streams are indented identically.
Since the RX stream received from the current development server has no
indent and also no newlines it is better to turn it of completely.
This might change in the future with structured logging (with the new
slog package) or command line flags to toggle this behaviour.
Re-encoding of the RX stream could also be an option but should stay one
because it alters the RX stream and might hide errors during debugging.
|
|
The prefix is re-implemented with this commit to distinguish between RX
and TX XML. Furthermore the logging is now based on the log module to
have the same (e.g. timestamp) prefix as other log messages.
|
|
This commit uses an io.TeeReader to achieve the same goal for RX like in
the previous commit for TX.
|
|
Using an io.MultiWriter it is trivially possible to write encoded tokens
to the TCP channel aswell as to stdout.
The disadvantage is that it is not possible to inject prefix data like
the so far used `C: ` only for stdout and not for the TCP channel. Such
a prefix is not wanted in the TCP channel and thus not wanted for both.
The solution to get a nice log is to implement a transparent logging
middleware which gets the raw TX stream and inserts a prefix at each
line before sending to stdout.
|
|
|
|
This allows the goroutine which fetches all tokens from the server to
forward them to the main goroutine of the session.
|
|
|
|
|
|
|