aboutsummaryrefslogtreecommitdiff
path: root/frontend/print.h
blob: 6b526aef79bf27fd8dca4c99c7499801ab9c6648 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <cstring>
#include <memory>
#include <functional>
#include <string>

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, std::function<void(FILE*)>> file = nullptr;
	static constexpr bool enable = true;
};