WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
logger.h
Go to the documentation of this file.
1#pragma once
2#include <streambuf>
3#include <memory>
4#include <string>
5#include "webcface/log.h"
6
8
9template <typename CharT>
10class BasicLoggerBuf final : public std::basic_streambuf<CharT> {
11 using traits_type = typename std::basic_streambuf<CharT>::traits_type;
12 using char_type = typename std::basic_streambuf<CharT>::char_type;
13 using int_type = typename std::basic_streambuf<CharT>::int_type;
14
15 static constexpr int buf_size = 1024;
16 CharT buf[buf_size];
17 // bufからあふれた分を入れる
18 std::basic_string<CharT> overflow_buf;
19
20 // どうせclientが消える時にはLoggerBufも消える
22 SharedString field;
23
24 int sync() override;
25 int_type overflow(int_type c) override;
26
27 public:
28 explicit BasicLoggerBuf(internal::ClientData *data_p, const SharedString &field);
29 ~BasicLoggerBuf() = default;
30};
31#if WEBCFACE_SYSTEM_DLLEXPORT
32extern template class BasicLoggerBuf<char>;
33extern template class BasicLoggerBuf<wchar_t>;
34#endif
37
Definition logger.h:10
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
Definition client_internal.h:35
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103