MCPcopy Create free account
hub / github.com/Norbyte/bg3se / Main

Method Main

LuaDebugger/Program.cs:13–45  ·  view source on GitHub ↗
(string[] args)

Source from the content-addressed store, hash-verified

11 class Program
12 {
13 static void Main(string[] args)
14 {
15 var currentPath = AppDomain.CurrentDomain.BaseDirectory;
16 var dap = new DAPStream();
17 FileStream logFile = null;
18
19 try
20 {
21 logFile = new FileStream(currentPath + "\\DAP.log", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
22 dap.EnableLogging(logFile);
23
24 var dapHandler = new DAPMessageHandler(dap);
25 dapHandler.EnableLogging(logFile);
26 dap.RunLoop();
27 }
28 catch (Exception e)
29 {
30 dap.SendEvent("output", new DAPOutputMessage
31 {
32 category = "important",
33 output = e.ToString()
34 });
35 dap.SendErrorReply(1, "initialize", "Internal error during initialization:\r\n" + e.ToString());
36
37 if (logFile != null)
38 {
39 using (var writer = new StreamWriter(logFile, Encoding.UTF8, 0x1000, true))
40 {
41 writer.Write(e.ToString());
42 }
43 }
44 }
45 }
46 }
47}

Callers

nothing calls this directly

Calls 6

SendEventMethod · 0.80
SendErrorReplyMethod · 0.80
EnableLoggingMethod · 0.45
RunLoopMethod · 0.45
ToStringMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected