Skip to content

Guzik1/Logger_for_.Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logger for C#/.Net

This project is a simple log manager with multi output and formaters.

General info

Features:

  • simple logs
  • 6 layer (Info, Info2, Warning, Error, FatalError, Debug)
  • default formater for console and files
  • console output (different colour for each layer)
  • file and multi-file outputs
  • Add own formater
  • Add own output

Setup

Nuget package available here! Compiling bin library is located in /bin folder.
Copy NLogger (.dll files) to your project.

Simple code example

string path = @"C://logs/log.txt";

Logger logger = new Logger();
logger.AddOutput(new FileOutput(path), new DefaultConsoleFormater());  // Add log to file output and custor formater.
logger.AddDefaultConsoleOutputAndDefaultConsoleFormater();  // Log on screen in console.

logger.Info("Info in consol and file.");  // Log on info layer.
logger.Debug("Method has run test!");  // Log on debug layer.

logger.FatalError("Aplication can be stoped!");   // Log on fatal error layer.

logger.Log(LogType.Warning, "warning message ...");  // basic log method, select message layer and send message.

For view examples click here.

Built with

  • .Net Core 3.1
  • NUnit Framework (for testing)

Status

Version: 1.0.0

License

MIT License © Sebastian Guzik.

About

Basic logger for C#/.Net

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages