feat: add setting to customize chat log timestamp (#6338)
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
- Minor: Added hotkey Action for opening account selector. (#6192)
|
- Minor: Added hotkey Action for opening account selector. (#6192)
|
||||||
- Minor: Add a setting to change the emote and badge thumbnail size. (#6126)
|
- 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 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: Commands are no longer tab-completable in the middle of messages. (#6273)
|
||||||
- Bugfix: Automatic streamer mode detection now works from Flatpak. (#6250)
|
- 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)
|
- Bugfix: Don't create native messaging manifest file if browser directory doesn't exist. (#6116)
|
||||||
|
|||||||
@@ -567,7 +567,10 @@ public:
|
|||||||
"/logging/separatelyStoreStreamLogs",
|
"/logging/separatelyStoreStreamLogs",
|
||||||
false,
|
false,
|
||||||
};
|
};
|
||||||
|
QStringSetting logTimestampFormat = {
|
||||||
|
"/logging/logTimestampFormat",
|
||||||
|
"hh:mm:ss",
|
||||||
|
};
|
||||||
QStringSetting logPath = {"/logging/path", ""};
|
QStringSetting logPath = {"/logging/path", ""};
|
||||||
|
|
||||||
QStringSetting pathHighlightSound = {"/highlighting/highlightSoundPath",
|
QStringSetting pathHighlightSound = {"/highlighting/highlightSoundPath",
|
||||||
|
|||||||
@@ -182,9 +182,13 @@ void LoggingChannel::addMessage(const MessagePtr &message,
|
|||||||
str.append("#" + message->channelName + " ");
|
str.append("#" + message->channelName + " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
str.append('[');
|
QString logTimestampFormat = getSettings()->logTimestampFormat;
|
||||||
str.append(now.toString("HH:mm:ss"));
|
if (logTimestampFormat != "Disable")
|
||||||
str.append("] ");
|
{
|
||||||
|
str.append('[');
|
||||||
|
str.append(now.toString(logTimestampFormat));
|
||||||
|
str.append("] ");
|
||||||
|
}
|
||||||
|
|
||||||
QString messageText;
|
QString messageText;
|
||||||
if (message->loginName.isEmpty())
|
if (message->loginName.isEmpty())
|
||||||
|
|||||||
@@ -521,7 +521,7 @@ void GeneralPage::initLayout(GeneralPageView &layout)
|
|||||||
->addTo(layout);
|
->addTo(layout);
|
||||||
|
|
||||||
layout.addDropdown<QString>(
|
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",
|
{"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",
|
"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"},
|
"hh:mm:ss.zzz", "hh:mm:ss.zzz a"},
|
||||||
|
|||||||
@@ -150,6 +150,21 @@ ModerationPage::ModerationPage()
|
|||||||
}).result());
|
}).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 =
|
QCheckBox *onlyLogListedChannels =
|
||||||
this->createCheckBox("Only log channels listed below",
|
this->createCheckBox("Only log channels listed below",
|
||||||
getSettings()->onlyLogListedChannels);
|
getSettings()->onlyLogListedChannels);
|
||||||
|
|||||||
Reference in New Issue
Block a user