blob: 105dd68f4c2753b6c1e939486eece1dfaf6cbfd9 (
plain) (
blame)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*
* Copyright Andrey Semashev 2007 - 2015.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
/*!
* \file debug_output_backend.cpp
* \author Andrey Semashev
* \date 08.11.2008
*
* \brief A logging sink backend that uses debugger output
*/
#ifndef BOOST_LOG_WITHOUT_DEBUG_OUTPUT
#include <boost/log/detail/config.hpp>
#include <string>
#include <boost/log/sinks/debug_output_backend.hpp>
#include <windows.h>
#include <boost/log/detail/header.hpp>
namespace boost {
BOOST_LOG_OPEN_NAMESPACE
namespace sinks {
BOOST_LOG_ANONYMOUS_NAMESPACE {
#if defined(BOOST_LOG_USE_CHAR)
inline void output_debug_string(const char* str)
{
OutputDebugStringA(str);
}
#endif // defined(BOOST_LOG_USE_CHAR)
#if defined(BOOST_LOG_USE_WCHAR_T)
inline void output_debug_string(const wchar_t* str)
{
OutputDebugStringW(str);
}
#endif // defined(BOOST_LOG_USE_WCHAR_T)
} // namespace
template< typename CharT >
BOOST_LOG_API basic_debug_output_backend< CharT >::basic_debug_output_backend()
{
}
template< typename CharT >
BOOST_LOG_API basic_debug_output_backend< CharT >::~basic_debug_output_backend()
{
}
//! The method puts the formatted message to the event log
template< typename CharT >
BOOST_LOG_API void basic_debug_output_backend< CharT >::consume(record_view const&, string_type const& formatted_message)
{
output_debug_string(formatted_message.c_str());
}
#ifdef BOOST_LOG_USE_CHAR
template class basic_debug_output_backend< char >;
#endif
#ifdef BOOST_LOG_USE_WCHAR_T
template class basic_debug_output_backend< wchar_t >;
#endif
} // namespace sinks
BOOST_LOG_CLOSE_NAMESPACE // namespace log
} // namespace boost
#include <boost/log/detail/footer.hpp>
#endif // !defined(BOOST_LOG_WITHOUT_DEBUG_OUTPUT)
|