Repo-Init
Loading...
Searching...
No Matches
Loki.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
connection/Http.hpp
"
4
5
#include <spdlog/details/null_mutex.h>
6
#include <spdlog/sinks/base_sink.h>
7
8
#include <mutex>
9
#include <string>
10
#include <vector>
11
12
namespace
spdlog::sinks
13
{
14
// NOLINTBEGIN
24
template
<
typename
Mutex>
class
loki_api_sink
:
public
base_sink<Mutex> {
25
public
:
31
explicit
loki_api_sink
(
const
std::string &lokiAddress);
32
36
~loki_api_sink
();
37
38
protected
:
47
void
sink_it_
(
const
details::log_msg &msg)
override
;
48
55
void
flush_
()
override
;
56
57
private
:
58
bool
_lokiAvailable
{
false
};
59
std::unique_ptr<HTTP>
_connHandler
;
60
std::string
_basicInformation
;
61
62
struct
logInfo_t
{
63
std::string
level
;
64
std::vector<std::pair<std::string, std::string>>
logs
;
65
};
66
std::vector<struct logInfo_t>
_internalLogBuffer
;
67
};
68
69
using
loki_api_sink_mt
=
loki_api_sink<std::mutex>
;
70
using
loki_api_sink_st
=
loki_api_sink<details::null_mutex>
;
71
// NOLINTEND
72
}
// namespace spdlog::sinks
Http.hpp
spdlog::sinks::loki_api_sink
Definition
Loki.hpp:24
spdlog::sinks::loki_api_sink::_connHandler
std::unique_ptr< HTTP > _connHandler
Definition
Loki.hpp:59
spdlog::sinks::loki_api_sink::flush_
void flush_() override
Definition
Loki.cpp:81
spdlog::sinks::loki_api_sink::_lokiAvailable
bool _lokiAvailable
Definition
Loki.hpp:58
spdlog::sinks::loki_api_sink::_internalLogBuffer
std::vector< struct logInfo_t > _internalLogBuffer
Definition
Loki.hpp:66
spdlog::sinks::loki_api_sink::sink_it_
void sink_it_(const details::log_msg &msg) override
Definition
Loki.cpp:66
spdlog::sinks::loki_api_sink::_basicInformation
std::string _basicInformation
Definition
Loki.hpp:60
spdlog::sinks::loki_api_sink::loki_api_sink
loki_api_sink(const std::string &lokiAddress)
Definition
Loki.cpp:19
spdlog::sinks::loki_api_sink::~loki_api_sink
~loki_api_sink()
spdlog::sinks
Definition
Loki.cpp:18
spdlog::sinks::loki_api_sink::logInfo_t
Definition
Loki.hpp:62
spdlog::sinks::loki_api_sink::logInfo_t::level
std::string level
Definition
Loki.hpp:63
spdlog::sinks::loki_api_sink::logInfo_t::logs
std::vector< std::pair< std::string, std::string > > logs
Definition
Loki.hpp:64
include
logging
Loki.hpp
Generated on Sun Dec 8 2024 15:15:45 for Repo-Init by
1.12.0