diff --git a/include/spdlog/sinks/msvc_sink.h b/include/spdlog/sinks/msvc_sink.h new file mode 100644 index 00000000..0bd8e821 --- /dev/null +++ b/include/spdlog/sinks/msvc_sink.h @@ -0,0 +1,50 @@ +// +// Copyright(c) 2016 Alexander Dalshov. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) +// + +#pragma once + +#if defined(_MSC_VER) + +#include +#include + +#include + +#include +#include + +namespace spdlog +{ +namespace sinks +{ +/* +* MSVC sink (logging using OutputDebugStringA) +*/ +template +class base_msvc_sink : public base_sink < Mutex > +{ +public: + explicit base_msvc_sink() + { + } + + void flush() override + { + } + +protected: + void _sink_it(const details::log_msg& msg) override + { + OutputDebugStringA(msg.formatted.c_str()); + } +}; + +typedef base_msvc_sink msvc_sink_mt; +typedef base_msvc_sink msvc_sink_st; + +} +} + +#endif