2020-11-26 01:25:22 -08:00
|
|
|
/**
|
2020-07-22 07:04:18 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* \section COPYRIGHT
|
2020-07-22 07:04:18 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* Copyright 2013-2020 Software Radio Systems Limited
|
2020-07-22 07:04:18 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* By using this file, you agree to the terms and conditions set
|
|
|
|
* forth in the LICENSE file which can be found at the top level of
|
|
|
|
* the distribution.
|
2020-07-22 07:04:18 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SRSLOG_DETAIL_LOG_BACKEND_H
|
|
|
|
#define SRSLOG_DETAIL_LOG_BACKEND_H
|
|
|
|
|
|
|
|
namespace srslog {
|
|
|
|
|
|
|
|
namespace detail {
|
|
|
|
|
2020-12-10 09:10:49 -08:00
|
|
|
struct log_entry;
|
|
|
|
|
2020-07-22 07:04:18 -07:00
|
|
|
/// The log backend receives generated log entries from the application. Each
|
|
|
|
/// entry gets distributed to the corresponding sinks.
|
|
|
|
/// NOTE: Thread safe class.
|
|
|
|
class log_backend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~log_backend() = default;
|
|
|
|
|
|
|
|
/// Starts the processing of incoming log entries.
|
|
|
|
/// NOTE: Calling this function more than once has no side effects.
|
|
|
|
virtual void start() = 0;
|
|
|
|
|
2021-01-28 03:17:18 -08:00
|
|
|
/// Pushes a log entry into the backend. Returns true on success, otherwise
|
|
|
|
/// false.
|
|
|
|
virtual bool push(log_entry&& entry) = 0;
|
2020-09-30 06:52:42 -07:00
|
|
|
|
|
|
|
/// Returns true when the backend has been started, otherwise false.
|
|
|
|
virtual bool is_running() const = 0;
|
2020-07-22 07:04:18 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace detail
|
|
|
|
|
|
|
|
} // namespace srslog
|
|
|
|
|
|
|
|
#endif // SRSLOG_DETAIL_LOG_BACKEND_H
|