Skip to content
forked from thatbakamono/Salem

A highly configurable logger written in C# and .Net Standard 2.0

License

Notifications You must be signed in to change notification settings

drake1011/Salem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Salem

A highly configurable logger written entirely in C# and .Net Standard 2.0

(more about the supported platforms below)

forthebadge forthebadge

Nuget

Status:

Branch Build Tests Code Quality
Master Travis (.org) master Azure DevOps tests CodeFactor Grade
Dev Travis (.org) dev CodeFactor Grade

Supported platforms:

  • .Net Core 2.0 and above
  • .Net Framework 4.6.1 and above
  • Mono 5.4 and above
  • Xamarin.iOS 10.14 and above
  • Xamarin.Mac 3.8 and above
  • Xamarin.Android 8.0 and above
  • UWP 10.0.16299 and above
  • 2018.1 and above

Usage

The simplest usage

using Salem;

var logger = new Logger();

//The first parameter - log level (for example: info, warning or error) (Not case-sensitive)
//The second parameter - our message (string or any object)
//The third parameter - scope (no need to specify if the same as scope in the constructor or empty)
logger.Log("Info", "Files have been loaded successfully");
logger.Log("Warning", "Aliens have arrived");
logger.Log("Error", "World is going to be destroyed by the aliens");

Screenshot

Formatters

Lists and dictionaries

Without a scope
using Salem;
using System.Collections.Generic;

var logger = new Logger();
var list = new List<string>() { "one", "two", "three" };

logger.Log("info", list);

Screenshot

using Salem;
using System.Collections.Generic;

var logger = new Logger();
var dict = new Dictionary<string, string>() { { "1", "first" }, { "2", "second" }, { "3", "third" } };

logger.Log("info", dict);

Screenshot

With a scope
using Salem;
using System.Collections.Generic;

var logger = new Logger("Scope");
var list = new List<string>() { "one", "two", "three" };

logger.Log("info", list);

Screenshot

using Salem;
using System.Collections.Generic;

var logger = new Logger("Scope");
var dict = new Dictionary<string, string>() { { "1", "first" }, { "2", "second" }, { "3", "third" } };

logger.Log("info", dict);

Screenshot

About

A highly configurable logger written in C# and .Net Standard 2.0

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%