Skip to content

Commit 90ab89b

Browse files
author
Russ Egan
committed
More readme
1 parent 181f6c6 commit 90ab89b

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

v2/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
Flume [![GoDoc](https://godoc.org/github.com/ThalesGroup/flume?status.png)](https://godoc.org/github.com/ThalesGroup/flume/v2) [![Go Report Card](https://goreportcard.com/badge/github.com/ThalesGroup/flume)](https://goreportcard.com/report/ThalesGroup/flume) [![Build](https://github.com/ThalesGroup/flume/workflows/Build/badge.svg)](https://github.com/ThalesGroup/flume/actions?query=branch%3Amaster+workflow%3ABuild+)
22
=====
33

4-
Flume is a handler for the log/slog package. A flume handler has a couple nifty capabilities:
4+
Flume is a handler for the log/slog package.
5+
6+
# Usage
7+
8+
go get github.com/ThalesGroup/flume/v2
9+
10+
Example:
11+
12+
import github.com/ThalesGroup/flume/v2
13+
14+
// configure logging from the environment, e.g.:
15+
// FLUME={"level":"INFO", "levels":{"http":"DEBUG"}, "handler":"json"}
16+
flume.MustConfigFromEnv()
17+
18+
l := flume.New("http") // equivalent to slog.New(flume.Default()).With(flume.LoggerKey, "http")
19+
l.Debug("hello world")
20+
21+
22+
# Features
23+
24+
A flume handler has a couple nifty capabilities:
525

626
- It enables different levels based on the value of a special `logger` attribute in the record.
727
For example, the default level might be INFO, but records with the attribute `logger=http` can be enabled at the debug level. (The attribute name is configurable).

0 commit comments

Comments
 (0)