mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
3c8992cac1
All occurrences of log() have been replaced with qDebug() bonus meme: remove a bunch of std::string usages in the pubsub client Fixes #1467
40 lines
847 B
C++
40 lines
847 B
C++
#include "singletons/Logging.hpp"
|
|
|
|
#include "Application.hpp"
|
|
#include "singletons/Paths.hpp"
|
|
#include "singletons/Settings.hpp"
|
|
|
|
#include <QDir>
|
|
#include <QStandardPaths>
|
|
|
|
#include <unordered_map>
|
|
|
|
namespace chatterino {
|
|
|
|
void Logging::initialize(Settings &settings, Paths &paths)
|
|
{
|
|
}
|
|
|
|
void Logging::addMessage(const QString &channelName, MessagePtr message)
|
|
{
|
|
if (!getSettings()->enableLogging)
|
|
{
|
|
return;
|
|
}
|
|
|
|
auto it = this->loggingChannels_.find(channelName);
|
|
if (it == this->loggingChannels_.end())
|
|
{
|
|
auto channel = new LoggingChannel(channelName);
|
|
channel->addMessage(message);
|
|
this->loggingChannels_.emplace(
|
|
channelName, std::unique_ptr<LoggingChannel>(std::move(channel)));
|
|
}
|
|
else
|
|
{
|
|
it->second->addMessage(message);
|
|
}
|
|
}
|
|
|
|
} // namespace chatterino
|