-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathAlt.Log.cs
61 lines (46 loc) · 1.62 KB
/
Alt.Log.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Text;
namespace AltV.Net
{
public static partial class Alt
{
private const string HourWithZero = "[0";
private const string HourWithoutZero = "[";
private const string NumberWithZero = ":0";
private const string NumberWithoutZero = ":";
private const string Ending = "] ";
public static void LogFast(string message)
{
var dateTimeNow = DateTime.Now;
var hour = dateTimeNow.Hour;
var minute = dateTimeNow.Minute;
var second = dateTimeNow.Second;
var stringBuilder = new StringBuilder();
stringBuilder.Append(hour < 10 ? HourWithZero : HourWithoutZero);
stringBuilder.Append(hour);
stringBuilder.Append(minute < 10 ? NumberWithZero : NumberWithoutZero);
stringBuilder.Append(minute);
stringBuilder.Append(second < 10 ? NumberWithZero : NumberWithoutZero);
stringBuilder.Append(second);
stringBuilder.Append(Ending);
stringBuilder.Append(message);
Console.WriteLine(stringBuilder.ToString());
}
public static void LogInfo(string message)
{
Alt.Core.LogInfo(message);
}
public static void LogDebug(string message)
{
Alt.Core.LogDebug(message);
}
public static void LogWarning(string message)
{
Alt.Core.LogWarning(message);
}
public static void LogError(string message)
{
Alt.Core.LogError(message);
}
}
}