A very simplistic .NET (dotnet) Core Logger that outputs colorful text to the console and displays the time at which the text was logged.
First, add a reference to the Nuget package. If you're using the dotnet CLI you can do so by running :
dotnet add package NarcityLogger --version 1.0.1
Otherwise, follow the instructions given on the Nuget package page that corresponds to your favorite package manager.
Now, to use the Logger in your source code, you only have to use the NarcityMedia.Log
namespace and you're good to go.
The following code:
using System;
using NarcityMedia.Log;
namespace LoggerTest
{
class Program
{
static void Main(string[] args)
{
NMLogger.Log("Normal");
NMLogger.Log("Success", LogType.Success);
NMLogger.Log("Info", LogType.Info);
NMLogger.Log("Warning", LogType.Warning);
NMLogger.Log("Error", LogType.Error);
}
}
}
Will produce the following output