|
| Debugger (bool enabled, bool verbose, int port, string address, string logPath="", LOG_LEVEL logLevel=LOG_LEVEL.INFO) |
|
void | ERROR< T > (T o, bool printExtraInfo=true) |
|
void | WARNING< T > (T o, bool printExtraInfo=true) |
|
void | INFO< T > (T o, bool printExtraInfo=true) |
|
void | DEBUG< T > (T o, bool printExtraInfo=true) |
|
Definition at line 5 of file Debugger.cs.
◆ Debugger() [1/2]
HSB.Debugger.Debugger |
( |
| ) |
|
Definition at line 20 of file Debugger.cs.
21 {
22 enabled = false;
23 verbose = true;
24 port = 8081;
25 address = "127.0.0.1";
26 logPath = Path.Combine(AppContext.BaseDirectory, $"log_{GetDateFormatted()}.txt");
27 logLevel = LOG_LEVEL.INFO;
28
29 StartDebugServer();
30 }
◆ Debugger() [2/2]
HSB.Debugger.Debugger |
( |
bool |
enabled, |
|
|
bool |
verbose, |
|
|
int |
port, |
|
|
string |
address, |
|
|
string |
logPath = "" , |
|
|
LOG_LEVEL |
logLevel = LOG_LEVEL::INFO |
|
) |
| |
Definition at line 33 of file Debugger.cs.
35 {
36 this.enabled = enabled;
37 this.verbose = verbose;
38 this.port = port;
39 this.address = address;
40 this.logPath = logPath == "" ? $"{AppContext.BaseDirectory}log_{GetDateFormatted()}.txt" : logPath;
41 this.logLevel = logLevel;
42
43 StartDebugServer();
44 }
◆ DEBUG< T >()
void HSB.Debugger.DEBUG< T > |
( |
T |
o, |
|
|
bool |
printExtraInfo = true |
|
) |
| |
Definition at line 108 of file Debugger.cs.
109 {
110 if (verbose)
111 Terminal.DEBUG(o, printExtraInfo);
112 if (logLevel == LOG_LEVEL.ALL && logLevel > 0 && o != null)
113 {
114 var msg = o.ToString() ?? "";
115 AppendToFile(GetMessage("D", msg));
116 }
117 }
◆ ERROR< T >()
void HSB.Debugger.ERROR< T > |
( |
T |
o, |
|
|
bool |
printExtraInfo = true |
|
) |
| |
Definition at line 73 of file Debugger.cs.
74 {
75 if (verbose)
76 Terminal.ERROR(o, printExtraInfo);
77 if((int) logLevel <= (int)LOG_LEVEL.ERROR && logLevel > 0 && o != null)
78 {
79 var msg = o.ToString() ?? "";
80 AppendToFile(GetMessage("W", msg));
81 }
82 }
◆ FromJson()
static Debugger HSB.Debugger.FromJson |
( |
JsonElement |
json | ) |
|
|
static |
Definition at line 61 of file Debugger.cs.
62 {
63 return new Debugger(
64 json.GetProperty("enabled").GetBoolean(),
65 json.GetProperty("verbose").GetBoolean(),
66 json.GetProperty("port").GetInt16(),
67 json.GetProperty("address").GetString() ?? "127.0.0.1",
68 json.GetProperty("logPath").GetString() ?? "",
69 (LOG_LEVEL)json.GetProperty("logLevel").GetInt16()
70 );
71 }
◆ INFO< T >()
void HSB.Debugger.INFO< T > |
( |
T |
o, |
|
|
bool |
printExtraInfo = true |
|
) |
| |
Definition at line 96 of file Debugger.cs.
97 {
98 if (verbose)
99 Terminal.INFO(o, printExtraInfo);
100
101 if((int) logLevel <= (int)LOG_LEVEL.INFO && logLevel > 0 && o != null)
102 {
103 var msg = o.ToString() ?? "";
104 AppendToFile(GetMessage("I", msg));
105 }
106 }
◆ WARNING< T >()
void HSB.Debugger.WARNING< T > |
( |
T |
o, |
|
|
bool |
printExtraInfo = true |
|
) |
| |
Definition at line 84 of file Debugger.cs.
85 {
86 if (verbose)
87 Terminal.WARNING(o, printExtraInfo);
88
89 if((int) logLevel <= (int)LOG_LEVEL.WARNING && logLevel > 0 && o != null)
90 {
91 var msg = o.ToString() ?? "";
92 AppendToFile(GetMessage("W", msg));
93 }
94 }
◆ address
string HSB.Debugger.address |
◆ enabled
bool HSB.Debugger.enabled |
◆ logLevel
LOG_LEVEL HSB.Debugger.logLevel |
◆ logPath
string HSB.Debugger.logPath |
◆ port
◆ UseDebugCertificate
bool HSB.Debugger.UseDebugCertificate |
◆ verbose
bool HSB.Debugger.verbose |
The documentation for this class was generated from the following file: