From 71af8c99cc7feb155f2044410e5f40865f3c6fa6 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sun, 17 Mar 2024 03:57:24 +0300 Subject: [PATCH] update loki sender --- .../gui/mods/wot_stat/common/serverLogger.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/WOTSTAT/res/scripts/client/gui/mods/wot_stat/common/serverLogger.py b/WOTSTAT/res/scripts/client/gui/mods/wot_stat/common/serverLogger.py index 1c3fe09..9acc26e 100644 --- a/WOTSTAT/res/scripts/client/gui/mods/wot_stat/common/serverLogger.py +++ b/WOTSTAT/res/scripts/client/gui/mods/wot_stat/common/serverLogger.py @@ -120,17 +120,20 @@ def send(self, level, msg): self.logs_queue.append(Message(level, msg)) def _sending_loop(self): - BigWorld.callback(5, self._sending_loop) + BigWorld.callback(10, self._sending_loop) try: if len(self.logs_queue) == 0: return + defaultStreamLabels = { + "source": "mod", + "region": _get_region(), + "modVersion": _get_mod_version(), + } + defaultStreamMeta = { - "service": "mod", "playerName": _get_player_name(), - "region": _get_region(), "gameVersion": _get_game_version(), - "modVersion": _get_mod_version(), "session": self.session_id } @@ -141,8 +144,8 @@ def _sending_loop(self): if len(current) == 0: continue streams.append({ - "stream": dict(defaultStreamMeta, level=level), - "values": map(lambda l: [str(l.time), l.message], current) + "stream": dict(defaultStreamLabels, level=level), + "values": map(lambda l: [str(l.time), l.message, defaultStreamMeta], current) }) data = {"streams": streams}