feat: add setting to customize chat log timestamp (#6338)

This commit is contained in:
droidicus
2025-07-19 06:30:31 -04:00
committed by GitHub
parent 4944ce326f
commit f20945edc7
5 changed files with 28 additions and 5 deletions
+1
View File
@@ -18,6 +18,7 @@
- Minor: Added hotkey Action for opening account selector. (#6192)
- Minor: Add a setting to change the emote and badge thumbnail size. (#6126)
- Minor: Add an import and export button to image uploader settings. (#6284)
- Minor: Add a setting under Moderation -> Logs to customize the timestamp used for chat logs. (#6338)
- Bugfix: Commands are no longer tab-completable in the middle of messages. (#6273)
- Bugfix: Automatic streamer mode detection now works from Flatpak. (#6250)
- Bugfix: Don't create native messaging manifest file if browser directory doesn't exist. (#6116)
+4 -1
View File
@@ -567,7 +567,10 @@ public:
"/logging/separatelyStoreStreamLogs",
false,
};
QStringSetting logTimestampFormat = {
"/logging/logTimestampFormat",
"hh:mm:ss",
};
QStringSetting logPath = {"/logging/path", ""};
QStringSetting pathHighlightSound = {"/highlighting/highlightSoundPath",
+7 -3
View File
@@ -182,9 +182,13 @@ void LoggingChannel::addMessage(const MessagePtr &message,
str.append("#" + message->channelName + " ");
}
str.append('[');
str.append(now.toString("HH:mm:ss"));
str.append("] ");
QString logTimestampFormat = getSettings()->logTimestampFormat;
if (logTimestampFormat != "Disable")
{
str.append('[');
str.append(now.toString(logTimestampFormat));
str.append("] ");
}
QString messageText;
if (message->loginName.isEmpty())
+1 -1
View File
@@ -521,7 +521,7 @@ void GeneralPage::initLayout(GeneralPageView &layout)
->addTo(layout);
layout.addDropdown<QString>(
"Timestamp format",
"Message timestamp format",
{"Disable", "h:mm", "hh:mm", "h:mm a", "hh:mm a", "h:mm:ss", "hh:mm:ss",
"h:mm:ss a", "hh:mm:ss a", "h:mm:ss.zzz", "h:mm:ss.zzz a",
"hh:mm:ss.zzz", "hh:mm:ss.zzz a"},
@@ -150,6 +150,21 @@ ModerationPage::ModerationPage()
}).result());
});
auto logsTimestampFormatLayout =
logs.emplace<QHBoxLayout>().withoutMargin();
auto logsTimestampFormatLabel =
logsTimestampFormatLayout.emplace<QLabel>();
logsTimestampFormatLabel->setText(
QString("Log file timestamp format: "));
QComboBox *logTimestampFormat = this->createComboBox(
{"Disable", "h:mm", "hh:mm", "h:mm a", "hh:mm a", "h:mm:ss",
"hh:mm:ss", "h:mm:ss a", "hh:mm:ss a", "h:mm:ss.zzz",
"h:mm:ss.zzz a", "hh:mm:ss.zzz", "hh:mm:ss.zzz a"},
getSettings()->logTimestampFormat);
logTimestampFormat->setToolTip("a = am/pm, zzz = milliseconds");
logsTimestampFormatLayout.append(logTimestampFormat);
QCheckBox *onlyLogListedChannels =
this->createCheckBox("Only log channels listed below",
getSettings()->onlyLogListedChannels);