BadScript 2
Loading...
Searching...
No Matches
BadConsoleLogWriter.cs
Go to the documentation of this file.
2
4
9{
15 protected override void Write(BadLog log)
16 {
17 ConsoleColor fg = BadConsole.ForegroundColor;
18 ConsoleColor bg = BadConsole.BackgroundColor;
19
20 switch (log.Type)
21 {
22 case BadLogType.Log:
23 BadConsole.ForegroundColor = BadLoggerSettings.Instance.LogForegroundColor;
24 BadConsole.BackgroundColor = BadLoggerSettings.Instance.LogBackgroundColor;
25
26 break;
27 case BadLogType.Warning:
28 BadConsole.ForegroundColor = BadLoggerSettings.Instance.WarnForegroundColor;
29 BadConsole.BackgroundColor = BadLoggerSettings.Instance.WarnBackgroundColor;
30
31 break;
32 case BadLogType.Error:
33 BadConsole.ForegroundColor = BadLoggerSettings.Instance.ErrorForegroundColor;
34 BadConsole.BackgroundColor = BadLoggerSettings.Instance.ErrorBackgroundColor;
35
36 break;
37 default:
38 throw new ArgumentOutOfRangeException();
39 }
40
42 BadConsole.ForegroundColor = fg;
43 BadConsole.BackgroundColor = bg;
44 }
45}
override void Write(BadLog log)
Writes a log message to the log writer.
Wrapper class for the console abstraction.
Definition BadConsole.cs:12
static ConsoleColor BackgroundColor
The Background Color.
Definition BadConsole.cs:40
static void WriteLine(string str)
Writes a string to the console and appends a newline.
Definition BadConsole.cs:76
static ConsoleColor ForegroundColor
The Foreground Color.
Definition BadConsole.cs:31
static T Instance
Returns the Instance of the Settings Provider.
Contains Writer Implementations for the BadScript Logging System.
Contains a Console Abstraction Layer to be able to Simulate Console Input/Output over the Network.
Definition BadConsole.cs:6
Represents a Log Message.
Definition BadLog.cs:12
readonly BadLogType Type
The Type of the message.
Definition BadLog.cs:26
override string ToString()
Returns a string representation of the log.
Definition BadLog.cs:66