forked from IceYGO/windbot
-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Logger.cs
40 lines (39 loc) · 1.19 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
using System;
#if LIBWINDBOT
using Android.Util;
#endif
namespace WindBot
{
public static class Logger
{
public static void WriteLine(string message)
{
#if !LIBWINDBOT
Console.WriteLine("[" + DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "] " + message);
#else
Log.Info("Edoprowindbot", "[" + DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "] " + message);
#endif
}
public static void DebugWriteLine(string message)
{
#if DEBUG
#if !LIBWINDBOT
Console.WriteLine("[" + DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "] " + message);
#else
Log.Debug("Edoprowindbot", "[" + DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "] " + message);
#endif
#endif
}
public static void WriteErrorLine(string message)
{
#if !LIBWINDBOT
Console.BackgroundColor = ConsoleColor.Red;
Console.ForegroundColor = ConsoleColor.White;
Console.Error.WriteLine("[" + DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "] " + message);
Console.ResetColor();
#else
Log.Error("Edoprowindbot", "[" + DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "] " + message);
#endif
}
}
}