From a83ff92bdd6f6ad4f937d43b01d545857b026bb7 Mon Sep 17 00:00:00 2001 From: Hideaki Terai Date: Thu, 9 Apr 2026 13:08:28 +0900 Subject: [PATCH] Log full message lines without snip truncation Console display continues to snip messages longer than 8 lines, but file and SQLite logs now record all lines by preserving fullLines before the snip and using it in the logging loop. Co-Authored-By: Claude Sonnet 4.6 --- lib/core.js | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/core.js b/lib/core.js index 81fdc63..9b52eed 100644 --- a/lib/core.js +++ b/lib/core.js @@ -144,10 +144,22 @@ core.display = (data, options) => { l ); - if (options.log || options.logSqlite) { - const plainDateFormat = removeEscapeSequences(dateFormat); - const plainChannel = removeEscapeSequences(channel); - const plainName = removeEscapeSequences(name); + name = chalk.white("|>"); + }); + + if (options && (options.log || options.logSqlite)) { + const plainDateFormat = data.time.format("YYYY-MM-DD HH:mm:ss"); + const plainChannel = removeEscapeSequences(channel); + const plainName = removeEscapeSequences( + util.users[data.user] + ? chalk[util.users[data.user].color](util.users[data.user].name) + : (typeof data.user === "string" ? data.user : "-") + ); + + (data.fullLines || data.lines).forEach((line) => { + let l = emoji.emojify(line); + l = util.replaceSlackId(l); + l = util.decolateText(l); const plainLine = removeEscapeSequences(l); if (options.log) { @@ -166,10 +178,8 @@ core.display = (data, options) => { data.threadTs || null ); } - } - - name = chalk.white("|>"); - }); + }); + } }; core.start = async (commander) => { @@ -421,6 +431,7 @@ core.start = async (commander) => { } } + let fullLines = lines; if (lines.length > 8) { lines = lines.slice(0, 5); lines.push("--- snip ---"); @@ -438,6 +449,7 @@ core.start = async (commander) => { let data = { bufferKey: (typeof message.channel == "string") ? resolveChannelLabelKey(message.channel) : "-", lines: lines, + fullLines: fullLines, time: time, channel: message.channel, user: message.user,