Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
Implementing

a custom writer:

class custom_writer : public base_writer {
public:
common::VoidResult write(common::interfaces::log_level level,
const std::string& message,
const std::string& file,
int line,
const std::string& function,
const std::chrono::system_clock::time_point& timestamp) override {
// Format the message
std::string formatted = format_log_entry(level, message, file, line, function, timestamp);
// Write to your custom destination
if (!write_to_destination(formatted)) {
return make_logger_void_result(logger_error_code::file_write_failed);
}
return common::ok(); // Success
}
common::VoidResult flush() override {
// Flush any buffered data
return flush_destination();
}
std::string get_name() const override {
return "custom_writer";
}
};
VoidResult ok()