Add logging to experimental IRC (#2996)
Co-authored-by: xHeaveny <69117321+xHeaveny@users.noreply.github.com> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -13,8 +13,10 @@ namespace chatterino {
|
||||
|
||||
QByteArray endline("\n");
|
||||
|
||||
LoggingChannel::LoggingChannel(const QString &_channelName)
|
||||
LoggingChannel::LoggingChannel(const QString &_channelName,
|
||||
const QString &_platform)
|
||||
: channelName(_channelName)
|
||||
, platform(_platform)
|
||||
{
|
||||
if (this->channelName.startsWith("/whispers"))
|
||||
{
|
||||
@@ -34,8 +36,9 @@ LoggingChannel::LoggingChannel(const QString &_channelName)
|
||||
QStringLiteral("Channels") + QDir::separator() + channelName;
|
||||
}
|
||||
|
||||
// FOURTF: change this when adding more providers
|
||||
this->subDirectory = "Twitch/" + this->subDirectory;
|
||||
// enforce capitalized platform names
|
||||
this->subDirectory = platform[0].toUpper() + platform.mid(1).toLower() +
|
||||
QDir::separator() + this->subDirectory;
|
||||
|
||||
getSettings()->logPath.connect([this](const QString &logPath, auto) {
|
||||
this->baseDirectory =
|
||||
|
||||
@@ -15,7 +15,8 @@ class Logging;
|
||||
|
||||
class LoggingChannel : boost::noncopyable
|
||||
{
|
||||
explicit LoggingChannel(const QString &_channelName);
|
||||
explicit LoggingChannel(const QString &_channelName,
|
||||
const QString &platform);
|
||||
|
||||
public:
|
||||
~LoggingChannel();
|
||||
@@ -34,6 +35,7 @@ private:
|
||||
QString generateDateString(const QDateTime &now);
|
||||
|
||||
const QString channelName;
|
||||
const QString platform;
|
||||
QString baseDirectory;
|
||||
QString subDirectory;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user