-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathHostLogger.cs
More file actions
64 lines (53 loc) · 1.76 KB
/
HostLogger.cs
File metadata and controls
64 lines (53 loc) · 1.76 KB
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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace Microsoft.DebugEngineHost
{
public static class HostLogger
{
private static ILogChannel s_natvisLogChannel;
private static ILogChannel s_engineLogChannel;
private static string s_engineLogFile;
public static void EnableNatvisDiagnostics(Action<string> callback, LogLevel level = LogLevel.Verbose)
{
if (s_natvisLogChannel == null)
{
// TODO: Support writing natvis logs to a file.
s_natvisLogChannel = new HostLogChannel(callback, null, level);
}
}
public static void EnableHostLogging(Action<string> callback, LogLevel level = LogLevel.Verbose)
{
if (s_engineLogChannel == null)
{
s_engineLogChannel = new HostLogChannel(callback, s_engineLogFile, level);
}
}
public static void SetEngineLogFile(string logFile)
{
s_engineLogFile = logFile;
}
public static ILogChannel GetEngineLogChannel()
{
return s_engineLogChannel;
}
public static ILogChannel GetNatvisLogChannel()
{
return s_natvisLogChannel;
}
public static void Reset()
{
s_natvisLogChannel?.Close();
s_natvisLogChannel = null;
s_engineLogChannel?.Close();
s_engineLogChannel = null;
}
public static bool IsFeedbackLogEnabled
{
get { return false; }
}
public static void WriteFeedbackLog(string message)
{
}
}
}