OpcUaCanOpen
CANopen OPC-UA server
WindowsDebuggerSink.cpp
Go to the documentation of this file.
1 /* © Copyright CERN, 2019. All rights not expressly granted are reserved.
2  * WindowsDebuggerSink.cpp
3  *
4  * Created on: Mar 18, 2019
5  * Author: Benjamin Farnham <benjamin.farnham@cern.ch>
6  *
7  * This file is part of Quasar.
8  *
9  * Quasar is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public Licence as published by
11  * the Free Software Foundation, either version 3 of the Licence.
12  *
13  * Quasar is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public Licence for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with Quasar. If not, see <http://www.gnu.org/licenses/>.
20  */
21 #ifdef _WIN32 // This LogIt back-end only applies to MS windows platforms
22 #include <WindowsDebuggerSink.h>
23 #include <iostream>
24 #include <sstream>
25 #include <windows.h>
26 
27 bool WindowsDebuggerSink::initialize()
28 {
29  std::cout << "WindowsDebuggerSink::initialize" << std::endl;
30  return true;
31 }
32 
33 void WindowsDebuggerSink::logMessage(const std::string& msg)
34 {
35  std::ostringstream out;
36  out << msg << "\n";
37  ::OutputDebugString(out.str().c_str());
38 }
39 #endif // _WIN32