Goby3 3.2.3
2025.05.13
Loading...
Searching...
No Matches
log_plugin.h
Go to the documentation of this file.
1// Copyright 2016-2025:
2// GobySoft, LLC (2013-)
3// Community contributors (see AUTHORS file)
4// File authors:
5// Toby Schneider <toby@gobysoft.org>
6//
7//
8// This file is part of the Goby Underwater Autonomy Project Libraries
9// ("The Goby Libraries").
10//
11// The Goby Libraries are free software: you can redistribute them and/or modify
12// them under the terms of the GNU Lesser General Public License as published by
13// the Free Software Foundation, either version 2.1 of the License, or
14// (at your option) any later version.
15//
16// The Goby Libraries are distributed in the hope that they will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU Lesser General Public License for more details.
20//
21// You should have received a copy of the GNU Lesser General Public License
22// along with Goby. If not, see <http://www.gnu.org/licenses/>.
23
24#ifndef GOBY_MIDDLEWARE_LOG_LOG_PLUGIN_H
25#define GOBY_MIDDLEWARE_LOG_LOG_PLUGIN_H
26
31
33
34namespace goby
35{
36namespace middleware
37{
38namespace log
39{
41{
42 public:
44 virtual ~LogPlugin() {}
45
46 virtual void register_write_hooks(std::ofstream& out_log_file) = 0;
47 virtual void register_read_hooks(const std::ifstream& in_log_file) = 0;
48
49 virtual std::string debug_text_message(LogEntry& log_entry)
50 {
51 throw(log::LogException("DEBUG_TEXT is not supported by the scheme's plugin"));
52 }
53
54 virtual std::vector<goby::middleware::HDF5ProtobufEntry> hdf5_entry(LogEntry& log_entry)
55 {
56 throw(log::LogException("HDF5 is not supported by the scheme's plugin"));
57 }
58
59 virtual std::shared_ptr<nlohmann::json> json_message(LogEntry& log_entry)
60 {
61 throw(log::LogException("JSON is not supported by the scheme's plugin"));
62 }
63};
64
65} // namespace log
66} // namespace middleware
67} // namespace goby
68
69#endif
virtual void register_write_hooks(std::ofstream &out_log_file)=0
virtual std::shared_ptr< nlohmann::json > json_message(LogEntry &log_entry)
Definition log_plugin.h:59
virtual std::string debug_text_message(LogEntry &log_entry)
Definition log_plugin.h:49
virtual std::vector< goby::middleware::HDF5ProtobufEntry > hdf5_entry(LogEntry &log_entry)
Definition log_plugin.h:54
virtual void register_read_hooks(const std::ifstream &in_log_file)=0
The global namespace for the Goby project.