refactor: Logging (chat logger) (#5058)
It's no longer a singleton It's now a unique_ptr that dies together with the Application * Add getChatLogger to EmptyApplication * unrelated change: Access Application::instance statically * fix logging init order * Add changelog entry
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
void Logging::initialize(Settings &settings, Paths & /*paths*/)
|
||||
Logging::Logging(Settings &settings)
|
||||
{
|
||||
// We can safely ignore this signal connection since settings are only-ever destroyed
|
||||
// on application exit
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/Singleton.hpp"
|
||||
#include "util/QStringHash.hpp"
|
||||
#include "util/ThreadGuard.hpp"
|
||||
|
||||
@@ -12,19 +11,15 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class Paths;
|
||||
class Settings;
|
||||
struct Message;
|
||||
using MessagePtr = std::shared_ptr<const Message>;
|
||||
class LoggingChannel;
|
||||
|
||||
class Logging : public Singleton
|
||||
class Logging
|
||||
{
|
||||
Paths *pathManager = nullptr;
|
||||
|
||||
public:
|
||||
Logging() = default;
|
||||
|
||||
void initialize(Settings &settings, Paths &paths) override;
|
||||
Logging(Settings &settings);
|
||||
|
||||
void addMessage(const QString &channelName, MessagePtr message,
|
||||
const QString &platformName);
|
||||
|
||||
Reference in New Issue
Block a user