41 #include <string_view>
76 size_t max_file_size{0};
79 uint32_t flush_interval_ms{0};
80 bool fixed_filename{
false};
82 bool block_when_full{
false};
147 void enable_backtrace(
size_t size) noexcept;
152 void disable_backtrace() noexcept;
168 [[nodiscard]]
bool has_error() const noexcept;
175 [[nodiscard]]
size_t get_max_task_count() const override;
182 void start_backend();
184 void initialize_fixed();
186 void initialize_timestamped();
188 void open_current(
bool append,
bool report_error = true);
190 void close_current() noexcept;
194 void rotate_timestamped();
198 void write_output(std::string_view data);
200 void update_timestamp(int64_t seconds);
202 std::string_view
format(const LoggerRecord& record);
204 void fail(std::string_view message) noexcept;
206 void flush_file() noexcept;
208 void write(std::unique_ptr<LoggerRecord>&& record) noexcept;
210 void barrier(
Callback&& callback) noexcept;
212 std::unique_ptr<Impl> impl_;
Copyable type-erased callable analogue of std::function with a tunable SBO and pool spill.
Definition: functional.h:132
MessageLoop-based asynchronous rotating-file backend.
Definition: logger_backend.h:67
void flush() noexcept
Drains non-evicted records preceding the barrier and flushes the active file.
LoggerBackend(Config &&config, ErrorHandler &&error_handler, ConsoleWriter &&console_writer=nullptr)
Constructs and starts the asynchronous backend.
~LoggerBackend() override
Drains records still pending at shutdown, flushes the file and stops the worker.
bool log(Logger::Level level, std::string_view message) noexcept
Enqueues one record.
Level
Message severity level.
Definition: logger.h:159
Serial task dispatcher with selectable queue backend and bounded timer registry.
Definition: message_loop.h:131
Pool-backed type-erased callables: copyable vlink::Function and move-only vlink::MoveFunction.
Singleton logger with stream / format / printf / RAII-stream entry points.
#define VLINK_EXPORT
Definition: macros.h:81
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
Definition: macros.h:174
Single-threaded task dispatcher with three queue backends, timers and scheduling envelopes.
Construction-time queue, file and formatting settings.
Definition: logger_backend.h:73
std::string log_path
Base directory for generated log files.
Definition: logger_backend.h:75
std::string app_name
Application name used by fixed-name rotation.
Definition: logger_backend.h:74