-
Notifications
You must be signed in to change notification settings - Fork 33
/
Logger.cs
32 lines (26 loc) · 969 Bytes
/
Logger.cs
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
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics;
namespace osu.Desktop.Deploy
{
public static class Logger
{
private static readonly Stopwatch stopwatch = Stopwatch.StartNew();
public static void Error(string message)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"FATAL ERROR: {message}");
Console.ResetColor();
Program.PauseIfInteractive();
Environment.Exit(-1);
}
public static void Write(string message, ConsoleColor col = ConsoleColor.Gray)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.Write(stopwatch.ElapsedMilliseconds.ToString().PadRight(8));
Console.ForegroundColor = col;
Console.WriteLine(message);
}
}
}