Description:
Tweak logging.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -40,7 +40,11 | |||||
|
40 | // private |
|
40 | // private |
|
41 | // |
|
41 | // |
|
42 |
|
42 | ||
|
43 | public static LogLevel minimumConsoleLevel = LogLevel.Info; |
|
43 | #if DEBUG |
|
|
44 | public static LogLevel minimumConsoleLevel = LogLevel.Debug; | ||
|
|
45 | #else | ||
|
|
46 | public static LogLevel minimumConsoleLevel = LogLevel.Success; | ||
|
|
47 | #endif | ||
|
44 |
|
48 | ||
|
45 | public static List<LogEntry> entries = new List<LogEntry>(); |
|
49 | public static List<LogEntry> entries = new List<LogEntry>(); |
|
46 | public static string logFileName = string.Format("log_{0:yyyyMMdd_HHmm}.txt", DateTime.Now); |
|
50 | public static string logFileName = string.Format("log_{0:yyyyMMdd_HHmm}.txt", DateTime.Now); |
@@ -52,9 +56,9 | |||||
|
52 | {LogLevel.Error, (ConsoleColor.Red, ConsoleColor.Black)}, |
|
56 | {LogLevel.Error, (ConsoleColor.Red, ConsoleColor.Black)}, |
|
53 | {LogLevel.Warning, (ConsoleColor.Yellow, ConsoleColor.Black)}, |
|
57 | {LogLevel.Warning, (ConsoleColor.Yellow, ConsoleColor.Black)}, |
|
54 | {LogLevel.Success, (ConsoleColor.Green, ConsoleColor.Black)}, |
|
58 | {LogLevel.Success, (ConsoleColor.Green, ConsoleColor.Black)}, |
|
55 |
{LogLevel.Info, (ConsoleColor. |
|
59 | {LogLevel.Info, (ConsoleColor.Blue, ConsoleColor.Black)}, |
|
56 | {LogLevel.Debug, (ConsoleColor.White, ConsoleColor.Blue)}, |
|
60 | {LogLevel.Debug, (ConsoleColor.White, ConsoleColor.Blue)}, |
|
57 |
{LogLevel.Trace, (ConsoleColor.White, ConsoleColor. |
|
61 | {LogLevel.Trace, (ConsoleColor.White, ConsoleColor.Yellow)}, |
|
58 | {LogLevel.Spy, (ConsoleColor.Black, ConsoleColor.White)}, |
|
62 | {LogLevel.Spy, (ConsoleColor.Black, ConsoleColor.White)}, |
|
59 |
|
63 | ||
|
60 | }; |
|
64 | }; |
@@ -65,7 +69,7 | |||||
|
65 | { |
|
69 | { |
|
66 | var timestamp = DateTime.Now; |
|
70 | var timestamp = DateTime.Now; |
|
67 |
|
71 | ||
|
68 | if ((level < minimumConsoleLevel) |
|
72 | if ((level <= minimumConsoleLevel) |
|
69 | || level == LogLevel.Spy) |
|
73 | || level == LogLevel.Spy) |
|
70 | { |
|
74 | { |
|
71 | var start_foreground = Console.ForegroundColor; |
|
75 | var start_foreground = Console.ForegroundColor; |
@@ -254,6 +254,18 | |||||
|
254 | Logging.Spy(new {debugInfo.cameraPosition, debugInfo.updateTime, test = 9.0f /2}); |
|
254 | Logging.Spy(new {debugInfo.cameraPosition, debugInfo.updateTime, test = 9.0f /2}); |
|
255 |
|
255 | ||
|
256 | } |
|
256 | } |
|
|
257 | |||
|
|
258 | if (ImGui.BeginCombo("Log Level", Logging.minimumConsoleLevel.ToString())) | ||
|
|
259 | { | ||
|
|
260 | foreach(LogLevel level in LogLevel.GetValues(typeof(LogLevel))) | ||
|
|
261 | { | ||
|
|
262 | if(ImGui.Selectable(level.ToString())) | ||
|
|
263 | { | ||
|
|
264 | Logging.minimumConsoleLevel = level; | ||
|
|
265 | } | ||
|
|
266 | } | ||
|
|
267 | } | ||
|
|
268 | |||
|
257 | if (debugInfo.pastFps.Length >= 1) |
|
269 | if (debugInfo.pastFps.Length >= 1) |
|
258 | { |
|
270 | { |
|
259 | ImGui.PlotLines("Frame Rate", ref debugInfo.pastFps[0], debugInfo.pastFps.Length); |
|
271 | ImGui.PlotLines("Frame Rate", ref debugInfo.pastFps[0], debugInfo.pastFps.Length); |
You need to be logged in to leave comments.
Login now