From 3562802cacc8dbd0c155146acfdb8d04c6440009 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 28 Oct 2024 15:41:35 +0100 Subject: implement transcript-style log --- frontend/print.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 frontend/print.h (limited to 'frontend/print.h') diff --git a/frontend/print.h b/frontend/print.h new file mode 100644 index 0000000..6b526ae --- /dev/null +++ b/frontend/print.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include +#include +#include + +void lprtf(const char * fmt, ...); + +class SessionLog { +public: + static SessionLog & get(); + +private: + SessionLog(); + virtual ~SessionLog() = default; + +public: + virtual void append(const std::string & str); + virtual void append(const char * str); + virtual void append(const char * buf, size_t buf_size); + +private: + std::unique_ptr> file = nullptr; + static constexpr bool enable = true; +}; + -- cgit v1.2.3