summaryrefslogtreecommitdiff
path: root/xmpp/log.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-07-01 20:25:26 +0200
committerxengineering <me@xengineering.eu>2023-07-01 20:25:26 +0200
commit8a0a460089d3ee1a2e1b69991da546034531f8de (patch)
treef13be75af3d694b60d3f63e988f8d3a71a8ee74c /xmpp/log.go
parentad882d60b7dabeb4d4ece6435c2fad9f23ab821f (diff)
downloadlimox-8a0a460089d3ee1a2e1b69991da546034531f8de.tar
limox-8a0a460089d3ee1a2e1b69991da546034531f8de.tar.zst
limox-8a0a460089d3ee1a2e1b69991da546034531f8de.zip
Add log module based XML logging with prefix
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.
Diffstat (limited to 'xmpp/log.go')
-rw-r--r--xmpp/log.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmpp/log.go b/xmpp/log.go
new file mode 100644
index 0000000..4ac0f88
--- /dev/null
+++ b/xmpp/log.go
@@ -0,0 +1,15 @@
+package xmpp
+
+import (
+ "log"
+)
+
+type logger struct {
+ prefix string
+}
+
+func (l logger) Write(p []byte) (n int, err error) {
+ log.Printf("%s%s", l.prefix, string(p))
+
+ return len(p), nil
+}