百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

Sherlog

> 编程语言
开源

针对 C# 和 Unity 的灵活日志记录

191 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

针对 C# 和 Unity 的灵活日志记录

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.

Install

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

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

Sherlog terminology

LogLevel

There are 6 log levels matching the Sherlog log methods:

csharp
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.

csharp
Logger.GlobalLogLevel = LogLevel.Warn;
csharp
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

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#dotnetloggerloggingtcp

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言