Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
msvc_sink.h
Go to the documentation of this file.
1//
2// Copyright(c) 2016 Alexander Dalshov.
3// Distributed under the MIT License (http://opensource.org/licenses/MIT)
4//
5
6#pragma once
7
8#if defined(_WIN32)
9
10#include "base_sink.h"
11#include "../details/null_mutex.h"
12
13#include <winbase.h>
14
15#include <mutex>
16#include <string>
17
18namespace spdlog
19{
20namespace sinks
21{
22/*
23* MSVC sink (logging using OutputDebugStringA)
24*/
25template<class Mutex>
26class msvc_sink : public base_sink < Mutex >
27{
28public:
29 explicit msvc_sink()
30 {
31 }
32
33
34
35protected:
36 void _sink_it(const details::log_msg& msg) override
37 {
38 OutputDebugStringA(msg.formatted.c_str());
39 }
40
41 void _flush() override
42 {}
43};
44
45typedef msvc_sink<std::mutex> msvc_sink_mt;
46typedef msvc_sink<details::null_mutex> msvc_sink_st;
47
48}
49}
50
51#endif
Definition json.hpp:4518