Cbeam
Loading...
Searching...
No Matches
logger.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2025 acrion innovations GmbH
3Authors: Stefan Zipproth, s.zipproth@acrion.ch
4
5This file is part of Cbeam, see https://github.com/acrion/cbeam and https://cbeam.org
6
7Cbeam is offered under a commercial and under the AGPL license.
8For commercial licensing, contact us at https://acrion.ch/sales. For AGPL licensing, see below.
9
10AGPL licensing:
11
12Cbeam is free software: you can redistribute it and/or modify
13it under the terms of the GNU Affero General Public License as published by
14the Free Software Foundation, either version 3 of the License, or
15(at your option) any later version.
16
17Cbeam is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU Affero General Public License for more details.
21
22You should have received a copy of the GNU Affero General Public License
23along with Cbeam. If not, see <https://www.gnu.org/licenses/>.
24*/
25
26#pragma once
27
28namespace cbeam::concurrency
29{
30 template <typename Derived>
31 class threaded_object;
32
33 template <typename Message>
34 class message_manager;
35}
36
37namespace cbeam::logging
38{
39 class logger
40 {
41 public:
42 logger(const std::filesystem::path& log_file_path, const std::size_t queue_size = 1);
43
44 private:
45 std::string create_json_log_entry(
46 const std::string& time_stamp,
47 const std::string& thread_id,
48 const std::string& thread_name,
49 const int log_level);
50
51 std::unique_ptr<concurrency::message_manager<message>> _message_manager;
52 };
53}
Definition message_manager.hpp:102
Definition threaded_object.hpp:97
logger(const std::filesystem::path &log_file_path, const std::size_t queue_size=1)
Provides concurrency primitives and abstractions for multithreaded programming. It features the power...
Definition message_manager.hpp:47
Offers flexible logging mechanisms to record messages with timestamps and thread information....
Definition logging_impl.hpp:53