登录 注册

woof

去点 Star
自动化与工作流数据分析与数据处理内容创作与媒体工具 loggerloggingscala
434
Stars
19
Forks
7
Watchers
8
Open Issues
NOASSERTION
许可证
Scala
语言
2021-10-11
创建时间
2026-11-11
最近更新

项目能做什么

Woof 是一个专为 Scala 3 和 Cats Effect 设计的纯函数式日志库。它解决了传统日志工具依赖运行时反射的问题,完全基于宏实现,并通过普通 Scala 代码进行配置。核心功能包括支持跨平台(JVM、Scala.js、Native)、结构化日志,以及提供 http4s 和 SLF4J 适配扩展。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Woof

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.legogroup/woof-core_3/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.legogroup/woof-core_3)
[![Scala CI](https://github.com/LEGO/woof/actions/workflows/scala.yml/badge.svg?branch=main)](https://github.com/LEGO/woof/actions/workflows/scala.yml)

A **pure** _(in both senses of the word!)_ **Scala 3** logging library with **no runtime reflection**.

![logo](dog-svgrepo-com.svg)

# Table of Contents
  - [Highlights](#highlights)
    - [Cross platform](#cross-platform)
  - [Installation](#installation)
  - [Example](#example)
  - [Can I use `SLF4J`?](#can-i-use-slf4j)
    - [Limitations of SLF4J bindings](#limitations-of-slf4j-bindings)
  - [Can I use `http4s`?](#can-i-use-http4s)
  - [Structured Logging](#structured-logging)

## Highlights

* Pure **Scala 3** library
* Made with _Cats Effect_
* Macro based (_no runtime reflection_)
* Configured with plain Scala code

### Cross platform

| Module  | JVM   | scala.js  | native |
|---------|-------|-----------|--------|
| core    | ✅    | ✅        | ✅     |
| http4s  | ✅    | ✅        | ✅     |
| slf4j   | ✅    | 🚫        | 🚫     |
| slf4j-2 | ✅    | 🚫        | 🚫     |

## Installation

> build.sbt

```scala
libraryDependencies ++= Seq(
  "org.legogroup" %% "woof-core"    % "$VERSION",
  "org.legogroup" %% "woof-slf4j"   % "$VERSION", // only if you need to use Woof via slf4j 1.x.x
  "org.legogroup" %% "woof-slf4j-2" % "$VERSION", // only if you need to use Woof via slf4j 2.x.x
  "org.legogroup" %% "woof-http4s"  % "$VERSION", // only if you need to add correlation IDs in http4s 
)
```

You can see a bunch of self-contained examples in the [examples](modules/examples) sub-project. To run them, open `sbt` and run the command `examples/run`:

```
sbt:root> examples/run

Multiple main classes detected. Select one to run:
 [1] examples.AtLeastLevel
 [2] examples.CustomPrinter
 [3] examples.CustomTheme
 [4] examples.ExactLevel
 [5] examples.FileOutput
 [6] examples.HelloWorld
 [7] examples.LogLevelFromEnv
 [8] examples.RegexFilter
 [9] examples.TaglessFinal

Enter number:
```

it will ask you for a number corresponding to the example you wish to run. For a self-contained `Scala.Js` example, look at [modules/examples-scalajs/src/main/scala/examples/HelloScalaJs.scala](modules/examples-scalajs/src/main/scala/examples/HelloScalaJs.scala)

## Example 

```scala
import cats.effect.IO
import org.legogroup.woof.{given, *}

val consoleOutput: Output[IO] = new Output[IO]:
  def output(str: String)      = IO.delay(println(str))
  def outputError(str: String) = output(str) // MDOC ignores stderr

given Filter = Filter.everything
given Printer = NoColorPrinter()

def program(using Logger[IO]): IO[Unit] = 
  for
    _ <- Logger[IO].debug("This is some debug")
    _ <- Logger[IO].info("HEY!")
    _ <- Logger[IO].warn("I'm warning you")
    _ <- Logger[IO].error("I give up")
  yield ()

val main: IO[Unit] = 
  for
    given Log
阅读完整原文

项目深度分析 AI 生成

企业级可观测性与云原生日志增强套件

产品构想以 Woof 为核心,构建面向企业分布式系统的商业扩展插件包,开箱即用集成 OpenTelemetry、AWS CloudWatch、Datadog 等生态,并提供敏感数据自动脱敏与结构化审计功能。
核心功能自动 OpenTelemetry Trace Context 注入;GDPR/PII 敏感字段自动正则屏蔽与脱敏;异步高性能云端日志传输器(Kinesis/S3/Logstash)。
目标用户金融科技、电商等对日志安全性与追踪有严格合规要求的 Scala 3 生产系统团队。
难度/周期中等 · 2-3 个月 · 成本:开发机器、多云测试环境 API 费用、测试用例构建与维护。
收费模式按商业授权(Commercial License)或企业订阅收费(按服务节点/每月收取支持费)。
竞争风险开源社区可能存在免费竞品(如 log4cats 社区生态);Scala 3 生态用户基数相对较窄。
依据 AI推测

Scala 3 微服务架构与纯函数式可观测性咨询服务

产品构想依托无反射、Native 编译支持等特性,提供 Scala 2 到 Scala 3 升级迁移、GraalVM 原生镜像打包及极致性能日志管道调优方案。
核心功能日志吞吐量性能调优审计报告;GraalVM Native-Image 零反射兼容配置落地;定制化企业日志标准设计。
目标用户从旧版 Scala 迁移到 Scala 3 或追求 Serverless 极低冷启动时间的工程团队。
难度/周期较高 · 按项目交付(每个项目 2-6 周) · 成本:主要是专家人力成本,基础设施成本极低。
收费模式按项目咨询费(Fixed-price contract)或按人天顾问费交付结算。
竞争风险获客成本高,需要极强的个人/团队声誉与 Scala 社区影响力。
依据 已验证事实

跨平台 Full-stack 实时日志与错误诊断控制台

产品构想利用 Woof 原生支持 Scala.js 和 Native 的跨端特性,打造轻量级前后端一体的调试日志同步面板,特别适用于 Scala 全栈应用内部排错。
核心功能前后端 Correlation-ID 统一追踪;浏览器端与服务器端日志统一聚合实时 WebSocket 调试控制台;本地/内网私有化轻量部署。
目标用户使用 Scala.js 配合后端 Scala 3 服务的全栈开发者和独立独立开发者。
难度/周期中等 · 1-2 个月 · 成本:UI 开发与跨端测试成本、少量静态服务器费用。
收费模式提供免费社区核心,高级功能(长久历史存储、团队协同排错、告警 webhook)采用 SaaS 订阅制。
竞争风险全栈 Scala.js 用户群体极度小众,转化率风险较高。
依据 尚需验证的假设
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建于 2021-10-11,近 30 天仍在推送,发布过 21 个 Release
社区活跃Star 434 / Fork 19 / Issue 8(数据支持,可自行核实)
许可证NOASSERTION
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。