• Stars
    star
    186
  • Rank 207,316 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Flexible logging for C# and Unity

Sherlog-Header

Sherlog – Flexible logging for C# and Unity

Sherlog is a very light logging library with a clear focus on speed, flexibility, and extensibility. It supports local and remote logging out of the box so you can receive log messages from other devices over the air.

CI Coverage Status NuGet License: MIT Twitter

Install

NuGet Unity Packages on OpenUPM
Sherlog NuGet openupm
Sherlog.Appenders NuGet openupm
Sherlog.Formatters NuGet openupm

Automated Unity Package Releases: https://github.com/sschmid/com.sschmid.sherlog

Quick Start

The SherlogSamples project contains samples for different use cases, such as logging to the console, adding colors or timestamps, and sending log messages via TCP to other devices.

See SherlogSamples

dotnet run --project samples/SherlogSamples/SherlogSamples.csproj

Run the SherlogServer project to receive the sample log messages from SherlogSamples via a TCP connection.

See SherlogServer

dotnet run --project samples/SherlogServer/SherlogServer.csproj listen 12345

SherlogSamples

Sherlog terminology

LogLevel

There are 6 log levels matching the Sherlog log methods:

logger.Trace("This is a message using logger.Trace()");
logger.Debug("This is a message using logger.Debug()");
logger.Info("This is a message using logger.Info()");
logger.Warn("This is a message using logger.Warn()");
logger.Error("This is a message using logger.Error()");
logger.Fatal("This is a message using logger.Fatal()");

You can set the log level per logger or globally for all existing and future loggers.

Logger.GlobalLogLevel = LogLevel.Warn;
var logger = Logger.GetLogger("MyLogger");
logger.LogLevel = LogLevel.Debug;

Only log methods that match or exceed the current log level will forward messages to appenders.

Appenders

Sherlog's plugin architecture lets you add multiple different appenders to handle log messages. An appender is a delegate method which contains the logic for processing log messages. It might write a message to a file, print it to the console or send it over the network via TCP. You can easily write your own appenders. There are no limits!

Sherlog comes with a handful of pre-made appenders and helper classes to get you started quickly:

see Sherlog.Appenders

Formatters

Similar to appenders you can add formatters to decorate messages with additional info like logger name, log level, timestamp, or color.

see Sherlog.Formatters

Maintainer(s)

@sschmid on GitHub - @s_schmid on Twitter

More Repositories

1

Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
C#
7,026
star
2

Match-One

This is a simple and interactive Unity3d example project to show how to use Entitas
C#
196
star
3

Entitas-Shmup

Entitas Shmup - An advanced example project to teach how to use Entitas with Unity physics and unit test
C#
75
star
4

bee

🐝 bee - plugin-based bash automation
Shell
72
star
5

Entitas-CSharp-Example

This is a simple and interactive Unity3d example project to show how to use Entitas
C#
47
star
6

Entitas-Standalone

Entitas-Standalone is a pure C# console app using Entitas
C#
32
star
7

Jenny

A lovely .NET Code Generator
C#
28
star
8

Promises-CSharp

Promises
C#
22
star
9

DesperateDevs

C#
18
star
10

pw-terminal-password-manager

πŸ” pw - Terminal Password Manager powered by fzf
Shell
14
star
11

Floc-Commands

A collection of commands with fluent API for Objective-C.
Objective-C
12
star
12

Gummi-Injection

A lightweight dependency injection framework for Objective-C
Objective-C
9
star
13

TCPeasy

πŸ”Œ Connecting sockets
C#
6
star
14

bee-unity

Useful functions for Unity development - https://github.com/sschmid/bee
Shell
6
star
15

com.sschmid.jenny

Automated Unity Package Releases of Jenny: https://github.com/sschmid/Jenny
C#
6
star
16

Floc-Dispatcher

An alternative to NSNotificationCenter.
Objective-C
6
star
17

SDObjection

A lightweight dependency injection framework for Objective-C.
Objective-C
5
star
18

com.sschmid.sherlog

Automated Unity Package Releases of Sherlog: https://github.com/sschmid/Sherlog
C#
5
star
19

bee-ios

Useful functions for iOS development - https://github.com/sschmid/bee
Shell
4
star
20

bee-android

Useful functions for Android development - https://github.com/sschmid/bee
Shell
4
star
21

com.sschmid.desperatedevs

Automated Unity Package Releases of DesperateDevs: https://github.com/sschmid/DesperateDevs
C#
4
star
22

bee-slack

Send messages via slack - https://github.com/sschmid/bee
Shell
3
star
23

beehub

Official bee plugin register - https://github.com/sschmid/bee
Shell
3
star
24

bee-macos

Useful functions for macOS - https://github.com/sschmid/bee
Shell
3
star
25

Gummi-Reflection

Reflection for Objective-C
Objective-C
3
star
26

Gummi-Commander

Event Command Mapping System for Objective-C
Objective-C
3
star
27

com.sschmid.tcpeasy

Automated Unity Package Releases of TCPeasy: https://github.com/sschmid/TCPeasy
C#
3
star
28

Unity-2021.3

Empty Unity 2021.3 default project to be used as a submodule for testing and running your code
3
star
29

.sln.dotsettings

Rider DotSettings
2
star
30

bee-tree

Create directory and file overviews with tree - https://github.com/sschmid/bee
Shell
2
star
31

RoslynTest

How to get all projects from a solution (old vs. sdk style)
C#
1
star
32

Unity-2018.4

Empty Unity 2018.4 default project to be used as a submodule for testing and running your code
1
star
33

Gummi-Dispatcher

Observe and dispatch any objects
Objective-C
1
star
34

bee-github

Useful functions for GitHub - https://github.com/sschmid/bee
Shell
1
star
35

Unity-2019.4

Empty Unity 2019.4 default project to be used as a submodule for testing and running your code
1
star
36

DesperateDevs.HelloWorld

C#
1
star
37

bee-plugin

Release bee plugins - https://github.com/sschmid/bee
Shell
1
star
38

sschmid.github.io

HTML
1
star
39

RoslynUnitTestIssue

Using Roslyn to get class attributes works in console app but fails in unit test
C#
1
star
40

Unity-2021.3.0f1

1
star
41

cocoapods-specs

CocoaPods specs
Ruby
1
star
42

kcov-coverage

Shell
1
star
43

gameci-test

Shell
1
star
44

bee-sample

A template for bee plugins - https://github.com/sschmid/bee
Shell
1
star
45

bee-changelog

Merge changes into changelog - https://github.com/sschmid/bee
Shell
1
star
46

Floc-Reflection

Reflection for Objective-C.
Objective-C
1
star
47

bee-semver

Read, write and bump version numbers - https://github.com/sschmid/bee
Shell
1
star
48

Unity-2020.3

Empty Unity 2020.3 default project to be used as a submodule for testing and running your code
1
star
49

Projects

1
star