Skip to content

Commit eaf120e

Browse files
committed
Update README and docs
1 parent 82848a5 commit eaf120e

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# devlog
22

3-
A structured logging handler for Go, with a human-readable output format designed for development
3+
A structured log handler for Go, with a human-readable output format designed for development
44
builds.
55

66
Run `go get hermannm.dev/devlog` to add it to your project!

buffer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (buffer byteBuffer) copy() byteBuffer {
111111
return newBuffer
112112
}
113113

114-
// Inspired by Jonathan Amsterdam's guide to writing structured logging handlers:
114+
// Inspired by Jonathan Amsterdam's guide to writing structured log handlers:
115115
// https://github.com/golang/example/blob/1d6d2400d4027025cb8edc86a139c9c581d672f7/slog-handler-guide/README.md#speed
116116
var bufferPool = sync.Pool{
117117
New: func() any {

doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Package devlog implements a structured logging (slog) handler, with a human-readable output
2-
// format designed for development builds.
1+
// Package devlog implements a structured log (slog) handler, with a human-readable output format
2+
// designed for development builds.
33
//
44
// A devlog.Handler can be configured as follows:
55
//

handler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"hermannm.dev/devlog"
1414
)
1515

16-
// Tests our handler against the standard library test suite for structured logging handlers.
16+
// Tests our handler against the standard library test suite for structured log handlers.
1717
func TestSlog(t *testing.T) {
1818
var buffer bytes.Buffer
1919

@@ -199,7 +199,7 @@ want:
199199
}
200200
}
201201

202-
// slogtest.Run requires us to parse our logging output to a map[string]any.
202+
// slogtest.Run requires us to parse our log output to a map[string]any.
203203
func parseLogEntry(entryString string) (map[string]any, error) {
204204
entry := make(map[string]any)
205205

log/log.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func WarnErrors(message string, errs ...error) {
210210
// Debug logs the given message at the DEBUG log level, along with any given log attributes.
211211
// It uses the [slog.Default] logger.
212212
//
213-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
213+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
214214
// case no output will be produced.
215215
//
216216
// # Log attributes
@@ -233,7 +233,7 @@ func Debug(message string, logAttributes ...any) {
233233
// Debugf creates a message from the given format and arguments using [fmt.Sprintf], and logs it at
234234
// the DEBUG log level. It uses the [slog.Default] logger.
235235
//
236-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
236+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
237237
// case no output will be produced.
238238
func Debugf(messageFormat string, formatArgs ...any) {
239239
if logger, enabled := defaultLogger(slog.LevelDebug); enabled {
@@ -244,7 +244,7 @@ func Debugf(messageFormat string, formatArgs ...any) {
244244
// DebugError logs the given error at the DEBUG log level, along with any given log attributes.
245245
// It uses the [slog.Default] logger.
246246
//
247-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
247+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
248248
// case no output will be produced.
249249
//
250250
// # Log attributes
@@ -267,7 +267,7 @@ func DebugError(err error, logAttributes ...any) {
267267
// DebugErrorCause logs the given message at the DEBUG log level, and adds a 'cause' attribute with
268268
// the given error, along with any other log attributes. It uses the [slog.Default] logger.
269269
//
270-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
270+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
271271
// case no output will be produced.
272272
//
273273
// # Log attributes
@@ -290,7 +290,7 @@ func DebugErrorCause(err error, message string, logAttributes ...any) {
290290
// DebugErrorCausef logs a formatted message (using [fmt.Sprintf]) at the DEBUG log level, and adds
291291
// a 'cause' attribute with the given error. It uses the [slog.Default] logger.
292292
//
293-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
293+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
294294
// case no output will be produced.
295295
func DebugErrorCausef(err error, messageFormat string, formatArgs ...any) {
296296
if logger, enabled := defaultLogger(slog.LevelDebug); enabled {
@@ -301,7 +301,7 @@ func DebugErrorCausef(err error, messageFormat string, formatArgs ...any) {
301301
// DebugErrors logs the given message at the DEBUG log level, and adds a 'cause' attribute with the
302302
// given errors. It uses the [slog.Default] logger.
303303
//
304-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
304+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
305305
// case no output will be produced.
306306
func DebugErrors(message string, errs ...error) {
307307
if logger, enabled := defaultLogger(slog.LevelDebug); enabled {
@@ -560,7 +560,7 @@ func (logger Logger) WarnErrors(message string, errs ...error) {
560560

561561
// Debug logs the given message at the DEBUG log level, along with any given log attributes.
562562
//
563-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
563+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
564564
// case no output will be produced.
565565
//
566566
// # Log attributes
@@ -583,7 +583,7 @@ func (logger Logger) Debug(message string, logAttributes ...any) {
583583
// Debugf creates a message from the given format and arguments using [fmt.Sprintf], and logs it at
584584
// the DEBUG log level.
585585
//
586-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
586+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
587587
// case no output will be produced.
588588
func (logger Logger) Debugf(messageFormat string, formatArgs ...any) {
589589
if level, enabled := logger.withLevel(slog.LevelDebug); enabled {
@@ -593,7 +593,7 @@ func (logger Logger) Debugf(messageFormat string, formatArgs ...any) {
593593

594594
// DebugError logs the given error at the DEBUG log level, along with any given log attributes.
595595
//
596-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
596+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
597597
// case no output will be produced.
598598
//
599599
// # Log attributes
@@ -616,7 +616,7 @@ func (logger Logger) DebugError(err error, logAttributes ...any) {
616616
// DebugErrorCause logs the given message at the DEBUG log level, and adds a 'cause' attribute with
617617
// the given error, along with any other log attributes.
618618
//
619-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
619+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
620620
// case no output will be produced.
621621
//
622622
// # Log attributes
@@ -639,7 +639,7 @@ func (logger Logger) DebugErrorCause(err error, message string, logAttributes ..
639639
// DebugErrorCausef logs a formatted message (using [fmt.Sprintf]) at the DEBUG log level, and adds
640640
// a 'cause' attribute with the given error.
641641
//
642-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
642+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
643643
// case no output will be produced.
644644
func (logger Logger) DebugErrorCausef(err error, messageFormat string, formatArgs ...any) {
645645
if level, enabled := logger.withLevel(slog.LevelDebug); enabled {
@@ -650,7 +650,7 @@ func (logger Logger) DebugErrorCausef(err error, messageFormat string, formatArg
650650
// DebugErrors logs the given message at the DEBUG log level, and adds a 'cause' attribute with the
651651
// given errors.
652652
//
653-
// Note that the DEBUG log level is typically disabled by default in most slog handlers, in which
653+
// Note that the DEBUG log level is typically disabled by default in most log handlers, in which
654654
// case no output will be produced.
655655
func (logger Logger) DebugErrors(message string, errs ...error) {
656656
if level, enabled := logger.withLevel(slog.LevelDebug); enabled {

0 commit comments

Comments
 (0)