-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logger.cs
28 lines (25 loc) · 873 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
using System;
using System.Runtime.CompilerServices;
namespace GarminMtpDataBackupper
{
public static class Logger
{
public static void Info(string message)
{
Console.WriteLine($"INFO: {message}");
}
public static void Warning(string message)
{
Console.WriteLine($"WARNING: {message}");
}
public static void Error(
string message,
Exception exception = null,
[CallerFilePath] string callerFilePath = "",
[CallerLineNumber] long callerLineNumber = 0,
[CallerMemberName] string callerMemberName = "")
{
Console.WriteLine($"ERROR:\n\tMessage: {message}\n\tException: {exception?.GetType()} - {exception?.Message}\n\tFile: {callerFilePath} : {callerLineNumber} : {callerMemberName}");
}
}
}