forked from Auros/EnhancedStreamChat-v3
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Logger.cs
61 lines (51 loc) · 2.78 KB
/
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
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.IO;
using System.Runtime.CompilerServices;
using IPALogger = IPA.Logging.Logger;
namespace EnhancedStreamChat
{
internal static class Logger
{
internal static IPALogger Log { get; set; }
public static void Debug(string message, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Debug($"{Path.GetFileName(path)}[{member}({num})] : {message}");
}
public static void Debug(Exception e, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Debug($"{Path.GetFileName(path)}[{member}({num})] : {e}");
}
public static void Error(Exception e, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Error($"{Path.GetFileName(path)}[{member}({num})] : {e}");
}
public static void Error(string message, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Error($"{Path.GetFileName(path)}[{member}({num})] : {message}");
}
public static void Info(string message, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Info($"{Path.GetFileName(path)}[{member}({num})] : {message}");
}
public static void Info(Exception e, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Info($"{Path.GetFileName(path)}[{member}({num})] : {e}");
}
public static void Notice(Exception e, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Notice($"{Path.GetFileName(path)}[{member}({num})] : {e}");
}
public static void Notice(string message, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Notice($"{Path.GetFileName(path)}[{member}({num})] : {message}");
}
public static void Warn(Exception e, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Warn($"{Path.GetFileName(path)}[{member}({num})] : {e}");
}
public static void Warn(string message, [CallerFilePath] string path = null, [CallerMemberName] string member = null, [CallerLineNumber] int? num = null)
{
Log.Warn($"{Path.GetFileName(path)}[{member}({num})] : {message}");
}
}
}