[GH-ISSUE #3261] Every chat message is logged twice, as [chat] and as [CHAT] #904

Closed
opened 2026-11-02 15:42:45 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Domanffe on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3261

🤖 Filed by Alexander's AI agent (Hermes), not by Alexander himself.

Version: 0.2.93 · OS: Windows 11
Where: the game's log file, %APPDATA%/horizon/logs/*.log

Every chat line is written to the log twice, once by chat_line and once by
Chat::add_message, so the same message appears as [chat] ... and as
[CHAT] ....

What I did: played on a server, then read the game log.
What happened: each message appears twice, on the line above itself.
What I expected: one line per message, as vanilla's ChatComponent.logChatMessage writes it ([CHAT]).

[03:19:52] [Render thread/INFO]: [chat] [❤] Иди к порталам, и выбери сервер для игры, либо воспользуйся компасом.
[03:19:52] [Render thread/INFO]: [CHAT] [❤] Иди к порталам, и выбери сервер для игры, либо воспользуйся компасом.

Two effects beyond the noise: launcher/src/telemetry.rs log_for_report keeps
[CHAT] lines out of a bug report's attached log, so chat the log deliberately
drops still leaves through the [chat] copy.

Hypothesis. Game::chat_line in crates/horizon-client/src/game/remote.rs logs log::info!("[chat] {text}") and then calls self.ui.chat.add(..), whose add_message in crates/horizon-client/src/chat.rs already logs [CHAT] through logging::write_only. Both sites arrived in the same commit (1569572ba), so one is a leftover. chat_line is the only writer of [chat] in the tree.

Acceptance: a chat message adds one line to the log, [CHAT] <text>, and no [chat] line.

Originally created by @Domanffe on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3261 > 🤖 Filed by Alexander's AI agent (Hermes), not by Alexander himself. **Version:** 0.2.93 · **OS:** Windows 11 **Where:** the game's log file, `%APPDATA%/horizon/logs/*.log` Every chat line is written to the log twice, once by `chat_line` and once by `Chat::add_message`, so the same message appears as `[chat] ...` and as `[CHAT] ...`. > What I did: played on a server, then read the game log. > What happened: each message appears twice, on the line above itself. > What I expected: one line per message, as vanilla's `ChatComponent.logChatMessage` writes it (`[CHAT]`). ``` [03:19:52] [Render thread/INFO]: [chat] [❤] Иди к порталам, и выбери сервер для игры, либо воспользуйся компасом. [03:19:52] [Render thread/INFO]: [CHAT] [❤] Иди к порталам, и выбери сервер для игры, либо воспользуйся компасом. ``` Two effects beyond the noise: `launcher/src/telemetry.rs` `log_for_report` keeps `[CHAT]` lines out of a bug report's attached log, so chat the log deliberately drops still leaves through the `[chat]` copy. **Hypothesis.** `Game::chat_line` in `crates/horizon-client/src/game/remote.rs` logs `log::info!("[chat] {text}")` and then calls `self.ui.chat.add(..)`, whose `add_message` in `crates/horizon-client/src/chat.rs` already logs `[CHAT]` through `logging::write_only`. Both sites arrived in the same commit (1569572ba), so one is a leftover. `chat_line` is the only writer of `[chat]` in the tree. **Acceptance:** a chat message adds one line to the log, `[CHAT] <text>`, and no `[chat]` line.
Author
Owner

@Domanffe commented on GitHub (Oct 28, 2026):

🤖 Agent: fixed in #3262. The duplicate is the log::info!("[chat] {text}") in Game::chat_line (crates/horizon-client/src/game/remote.rs); Chat::add_message in crates/horizon-client/src/chat.rs already writes the [CHAT] line, so the branch deletes the chat_line one and leaves the log at one line per message.

<!-- gh-comment-id:6473926271 --> @Domanffe commented on GitHub (Oct 28, 2026): 🤖 Agent: fixed in #3262. The duplicate is the `log::info!("[chat] {text}")` in `Game::chat_line` (`crates/horizon-client/src/game/remote.rs`); `Chat::add_message` in `crates/horizon-client/src/chat.rs` already writes the `[CHAT]` line, so the branch deletes the `chat_line` one and leaves the log at one line per message.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#904
No description provided.