Line data Source code
1 : //
2 : // Copyright (c) 2025 Vinnie Falco (vinnie dot falco at gmail dot com)
3 : //
4 : // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 : //
7 : // Official repository: https://github.com/cppalliance/beast2
8 : //
9 :
10 : #include <boost/beast2/log_service.hpp>
11 : #include <boost/beast2/logger.hpp>
12 :
13 : namespace boost {
14 : namespace beast2 {
15 :
16 : namespace {
17 :
18 : class log_service_impl
19 : : public log_service
20 : {
21 : public:
22 : using key_type = log_service;
23 :
24 : section
25 0 : get_section(
26 : core::string_view name) override
27 : {
28 0 : return ls_.get(name);
29 : }
30 :
31 : auto
32 0 : get_sections() const noexcept ->
33 : std::vector<section> override
34 : {
35 0 : return ls_.get_sections();
36 : }
37 :
38 : private:
39 : log_sections ls_;
40 : };
41 :
42 : } // (anon)
43 :
44 : log_service&
45 0 : use_log_service(
46 : polystore& ps)
47 : {
48 0 : return ps.try_emplace<log_service_impl>();
49 : }
50 :
51 : } // beast2
52 : } // boost
|