kodi
DarwinInterfaceForCLog.h
1 /*
2  * Copyright (C) 2020 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "platform/posix/utils/PosixInterfaceForCLog.h"
12 
13 #include <memory>
14 
15 #include <spdlog/formatter.h>
16 #include <spdlog/sinks/sink.h>
17 
18 class CDarwinInterfaceForCLog : public CPosixInterfaceForCLog, public spdlog::sinks::sink
19 {
20 public:
22  ~CDarwinInterfaceForCLog() override = default;
23 
24  // specialization of CPosixInterfaceForCLog
25  void AddSinks(
26  std::shared_ptr<spdlog::sinks::dist_sink<std::mutex>> distributionSink) const override;
27 
28  // implementations of spdlog::sink
29  void log(const spdlog::details::log_msg& msg) override;
30  void flush() override;
31  void set_pattern(const std::string& pattern) override;
32  void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) override;
33 
34 private:
35  std::unique_ptr<spdlog::formatter> m_formatter;
36 };
Definition: PosixInterfaceForCLog.h:13
Definition: DarwinInterfaceForCLog.h:18
Definition: IPlatformLog.h:26