diff --git a/Example/Program.cs b/Example/Program.cs
index 4c416ad..e96a36d 100644
--- a/Example/Program.cs
+++ b/Example/Program.cs
@@ -1,6 +1,6 @@
using System;
using System.IO;
-using EasyLog;
+using EasyLogPlus;
namespace Example {
class Program {
@@ -9,21 +9,27 @@ class Program {
//If you want change logger settings create function like this and call it when application starts
static void SetConfig() {
- cfg.LogPath = Environment.CurrentDirectory + @"\Application.log"; //Set path where you want log to be saved
- cfg.ShowDate = true; //If this is set to true it will add date to the log
- cfg.Console = true; //If this is set to true it will print the log to Console too
+ cfg.LogPath = Environment.CurrentDirectory + @"\Application.log"; // Set path where you want log to be saved
+ cfg.ShowDate = true; // If this is set to true it will add date to the log
+ cfg.Console = true; // If this is set to true it will print the log to Console too
}
static void Main(string[] args) {
SetConfig();
log.cfg = cfg;
- log.InitLogger(); //Call this to init logger
- log.Info("This is info text!");
+ log.InitLogger(); // Call this to init logger
+
log.Debug("This is debug text!");
+ log.Info("This is info text!");
+ log.Notice("This is notice text!");
log.Warning("This is warning text!");
log.Error("This is error text!");
log.Critical("This is critical text!");
+ log.Alert("This is alert text!");
+ log.Emergency("This is emergency text!");
+
log.Info("Press any key to stop this example!");
+
Console.ReadKey();
}
}
diff --git a/LICENSE b/LICENSE
index 724f31b..3efc66a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,7 @@
MIT License
Copyright (c) 2022 0x74
+Copyright (c) 2022 Asoji
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index dde3238..2ce2add 100644
--- a/README.md
+++ b/README.md
@@ -1,33 +1,70 @@
- EasyLog
+ EasyLogPlus
- Simple and easy to use logging system.
+ Simple and easy to use logging system originally created by 0x74. Extended by asoji.
+
+
+## What's different between this and the original repo?
+- Uses .NET 6 instead of .NET Framework 4.x
+- The text is more way readable [in my opinion]*
+- Customizable severity level colors
+- Added the whole Syslog Severity Level standardization [[read about that here](https://en.wikipedia.org/wiki/Syslog#Severity_level)], cranking from 4 severity levels to 8.
+- Uses your local timezone in logs instead of UTC timezone
+- Switchable between `:` and `=>` in logs, like `NOTICE: This is notice text!` or `NOTICE => This is notice text!` using `cfg.UseColon`
+- **Probably a lot of breaking changes**, but I plan on basically keeping this seperate from the original project.
+
+Basically, I should've just made my own logger considering how much I changed, but eh, this fork works, and I'm pretty happy with it.
+
+*- This is what the original looked like on my screen in Rider and **oh no**.
+
+![ohno](https://user-images.githubusercontent.com/99072163/186800223-deffa9b9-eea4-40bc-a148-5d3262abf8de.png)
+
+It looks a lot better like this now
+
+![ohyes](https://user-images.githubusercontent.com/99072163/186800405-88117e0d-6ce8-4504-97cd-b477f15cfd78.png)
+
## How to use?
-- Install Easy-Log from nuget or run this command in NuGet Package manager ``` Install-Package Easy-Log -Version 1.0.5 ```
-- Add ``` using EasyLog; ```
+- Install EasyLog from GitHub's NuGet Registry, instructions [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#installing-a-package), make sure it's authors are `0x74, extended by asoji`
+- Add `using EasyLog;`
to top
Then add
```cs
Logger log = new Logger();
Config cfg = new Config();
```
-If you want customize settings add
+
+
+## Customization Options
+If you want customize settings add these, keeping in mind that this whole `SetConfig()` is optional, and not required to run the application.
```cs
void SetConfig()
{
- cfg.LogPath = Environment.CurrentDirectory + @"\Application.log";//Set path where you want log to be saved
- cfg.ShowDate = true;//If this is set to true it will add date to the log
- cfg.Console = true;//If this is set to true it will print the log to Console too
+ cfg.LogPath = Environment.CurrentDirectory + @"\Application.log"; //Set path where you want log to be saved
+ cfg.ShowDate = true; // If this is set to true it will add date to the log
+ cfg.Console = true; // If this is set to true it will print the log to Console too
+
+ // ENTIRELY optional, just add and change if you want.
+ cfg.UseColon = true; // If set to true, uses `:` in logs instead of `=>`
+
+ cfg.DebugForeground = ConsoleColor.Blue;
+ cfg.InfoForeground = ConsoleColor.Gray;
+ cfg.NoticeForeground = ConsoleColor.Green;
+ cfg.WarningForeground = ConsoleColor.DarkYellow;
+ cfg.ErrorForeground = ConsoleColor.Red;
+
+ cfg.CriticalBackground = ConsoleColor.DarkRed;
+ cfg.AlertBackground = ConsoleColor.DarkBlue;
+ cfg.EmergencyBackground = ConsoleColor.DarkMagenta;
}
```
-Then in your application main void add these
+Then in your application main void add these, **this is required**.
```cs
log.cfg = cfg;
SetConfig();
-log.InitLogger();//Call this to init logger
+log.InitLogger(); // Call this to init logger
```
## Sending logs
@@ -41,6 +78,11 @@ log.Debug("Hello from log, this is debug");
log.Info("Hello from log, this is info");
```
+- Notice Log
+```cs
+log.Notice("Hello from log, this is notice");
+```
+
- Warning Log
```cs
log.Warning("Hello from log, this is warning");
@@ -50,3 +92,55 @@ log.Warning("Hello from log, this is warning");
```cs
log.Error("Hello from log, this is error");
```
+
+- Critical Log
+```cs
+log.Critical("Hello from log, this is critical")
+```
+
+- Alert Log
+```cs
+log.Alert("Hello from log, this is alert")
+```
+
+- Emergency Log
+```cs
+log.Emergency("Hello from log, this is emergency")
+```
+
+## [terrible] Example
+
+```cs
+class Program {
+ static Logger log = new Logger();
+ static Config cfg = new Config();
+
+ static void SetConfig() {
+ cfg.LogPath = Environment.CurrentDirectory + @"\Application.log";
+ cfg.ShowDate = true;
+ cfg.Console = true;
+
+ cfg.UseColon = false;
+
+ cfg.CriticalBackground = ConsoleColor.Cyan;
+ }
+
+ static void Main(string[] args) {
+ SetConfig();
+ log.cfg = cfg;
+ log.InitLogger();
+
+ try {
+ // do some random shit
+ } catch (ArgumentOutOfRangeException outOfRangeException) {
+ log.Error("hey something is out of range?");
+ }
+
+ Console.ReadKey();
+ }
+ }
+```
+
+## License
+
+This project [well, fork] is [MIT Licensed](LICENSE). Thank you byte-0x74/0x74 for making the original lib C:
\ No newline at end of file