OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/logging.h" | 5 #include "remoting/host/logging.h" |
6 | 6 |
7 #include <guiddef.h> | 7 #include <guiddef.h> |
8 | 8 |
9 #include "base/file_path.h" | |
10 #include "base/logging.h" | 9 #include "base/logging.h" |
11 #include "base/logging_win.h" | 10 #include "base/logging_win.h" |
12 #include "remoting/host/branding.h" | |
13 | 11 |
14 // {2db51ca1-4fd8-4b88-b5a2-fb8606b66b02} | 12 // {2db51ca1-4fd8-4b88-b5a2-fb8606b66b02} |
15 const GUID kRemotingHostLogProvider = | 13 const GUID kRemotingHostLogProvider = |
16 { 0x2db51ca1, 0x4fd8, 0x4b88, | 14 { 0x2db51ca1, 0x4fd8, 0x4b88, |
17 { 0xb5, 0xa2, 0xfb, 0x86, 0x06, 0xb6, 0x6b, 0x02 } }; | 15 { 0xb5, 0xa2, 0xfb, 0x86, 0x06, 0xb6, 0x6b, 0x02 } }; |
18 | 16 |
19 namespace remoting { | 17 namespace remoting { |
20 | 18 |
21 void InitHostLogging() { | 19 void InitHostLogging() { |
22 #if defined(NDEBUG) | 20 // Write logs to the system debug log. |
23 // Write logs to the system debug log in release build. | |
24 logging::InitLogging( | 21 logging::InitLogging( |
25 NULL, | 22 NULL, |
26 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, | 23 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
27 logging::LOCK_LOG_FILE, | 24 logging::DONT_LOCK_LOG_FILE, |
28 logging::DELETE_OLD_LOG_FILE, | 25 logging::DELETE_OLD_LOG_FILE, |
29 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 26 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
30 #else // !defined(NDEBUG) | |
31 // Write logs to a file in debug build. | |
32 FilePath debug_log = remoting::GetConfigDir(). | |
33 Append(FILE_PATH_LITERAL("debug.log")); | |
34 logging::InitLogging( | |
35 debug_log.value().c_str(), | |
36 logging::LOG_ONLY_TO_FILE, | |
37 logging::LOCK_LOG_FILE, | |
38 logging::DELETE_OLD_LOG_FILE, | |
39 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | |
40 #endif // !defined(NDEBUG) | |
Jamie
2013/01/07 18:31:21
This disables logging entirely for debug builds, c
alexeypa (please no reviews)
2013/01/07 19:10:31
This disables logging to a file. Logging to ETW is
| |
41 | 27 |
42 // Enable trace control and transport through event tracing for Windows. | 28 // Enable trace control and transport through event tracing for Windows. |
43 logging::LogEventProvider::Initialize(kRemotingHostLogProvider); | 29 logging::LogEventProvider::Initialize(kRemotingHostLogProvider); |
44 } | 30 } |
45 | 31 |
46 } // namespace remoting | 32 } // namespace remoting |
OLD | NEW |