-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.cs
More file actions
26 lines (18 loc) · 1.2 KB
/
Logger.cs
File metadata and controls
26 lines (18 loc) · 1.2 KB
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
using System;
namespace QwertyClicker
{
public partial class Logger
{
// DO NOT CALL DIRECTLY!
private static void writeFile(string text)
{
File.AppendAllText(Directory.GetCurrentDirectory() + "\\QwertyClicker-" + DateTime.Now.ToString("MM-dd-yy") + ".log", text + Environment.NewLine);
}
public static void info(string message) => Logger.writeFile(DateTime.Now.ToString("HH:mm:ss.ff MM/dd/yyyy") + " [INFO] " + message);
public static void warning(string message) => Logger.writeFile(DateTime.Now.ToString("HH:mm:ss.ff MM/dd/yyyy") + " [WARN] " + message);
public static void error(string message) => Logger.writeFile(DateTime.Now.ToString("HH:mm:ss.ff MM/dd/yyyy") + " [ERROR] " + message);
public static void emergency(string message) => Logger.writeFile(DateTime.Now.ToString("HH:mm:ss.ff MM/dd/yyyy") + " [EMERGENCY] " + message);
public static void notice(string message) => Logger.writeFile(DateTime.Now.ToString("HH:mm:ss.ff MM/dd/yyyy") + " [NOTICE] " + message);
public static void debug(string message) => Logger.writeFile(DateTime.Now.ToString("HH:mm:ss.ff MM/dd/yyyy") + " [DEBUG] " + message);
}
}