Chatterino
Logging.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "common/Singleton.hpp"
4 
5 #include "messages/Message.hpp"
7 
8 #include <memory>
9 
10 namespace chatterino {
11 
12 class Paths;
13 
14 class Logging : public Singleton
15 {
16  Paths *pathManager = nullptr;
17 
18 public:
19  Logging() = default;
20 
21  virtual void initialize(Settings &settings, Paths &paths) override;
22 
23  void addMessage(const QString &channelName, MessagePtr message,
24  const QString &platformName);
25 
26 private:
27  using PlatformName = QString;
28  using ChannelName = QString;
29  std::map<PlatformName,
30  std::map<ChannelName, std::unique_ptr<LoggingChannel>>>
31  loggingChannels_;
32 };
33 
34 } // namespace chatterino
void addMessage(const QString &channelName, MessagePtr message, const QString &platformName)
Definition: Logging.cpp:21
Definition: Logging.hpp:14
Definition: Singleton.hpp:10
Definition: Application.cpp:48
Settings which are availlable for reading and writing on the gui thread.
Definition: Settings.hpp:78
Definition: Paths.hpp:8
virtual void initialize(Settings &settings, Paths &paths) override
Definition: Logging.cpp:17
std::shared_ptr< const Message > MessagePtr
Definition: Channel.hpp:18