SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PacketOutputWindowLogger.cpp
Go to the documentation of this file.
1 /*
2 * Original work: Copyright (c) 2014, Oculus VR, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7 * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8 *
9 *
10 * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
11 *
12 * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13 * license found in the license.txt file in the root directory of this source tree.
14 */
15
16 #include "slikenet/NativeFeatureIncludes.h"
17 #if _RAKNET_SUPPORT_PacketLogger==1
18
19 #if defined(UNICODE)
20 #include "slikenet/wstring.h"
21 #endif
22
23 #include "slikenet/PacketOutputWindowLogger.h"
24 #include "slikenet/string.h"
25 #if defined(_WIN32)
26 #include "slikenet/WindowsIncludes.h"
27 #endif
28
29 using namespace SLNet;
30
31 PacketOutputWindowLogger::PacketOutputWindowLogger()
32 {
33 }
34 PacketOutputWindowLogger::~PacketOutputWindowLogger()
35 {
36 }
37 void PacketOutputWindowLogger::WriteLog(const char *str)
38 {
39 #if defined(_WIN32)
40
41 #if defined(UNICODE)
42 SLNet::RakWString str2 = str;
43 str2+="\n";
44 OutputDebugString(str2.C_String());
45 #else
46 SLNet::RakString str2 = str;
47 str2+="\n";
48 OutputDebugString(str2.C_String());
49 #endif
50 // DS_APR
51 #elif defined(__native_client__)
52 fprintf(stderr, "%s\n", str);
53 // /DS_APR
54 #endif
55 }
56
57 #endif // _RAKNET_SUPPORT_*