Skip to content

Commit 874bda5

Browse files
committed
feat: add additional documentation
1 parent eca3e6a commit 874bda5

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Coverage Status](https://coveralls.io/repos/github/YoSev/debugo/badge.svg?branch=main)](https://coveralls.io/github/YoSev/debugo?branch=main)
88

9-
A lightweight, colorful, and flexible debugging utility for Go — inspired by [debug](https://github.com/debug-js/debug) in Node.js.
9+
A lightweight, colorful, and flexible logging utility for Go — inspired by [debug](https://github.com/debug-js/debug) in Node.js.
1010

1111
`debugo` provides namespaced, timestamped, and color-coded logging with support for inclusion/exclusion patterns and pluggable output streams.
1212

@@ -17,9 +17,11 @@ A lightweight, colorful, and flexible debugging utility for Go — inspired by [
1717
- ✅ Namespaced debug logs (`namespace:subspace`)
1818
- 🎨 Automatic and consistent color assignment per namespace
1919
- 🕒 Time elapsed since last log (e.g., `+3ms`)
20-
- 🧪 Wildcard-based inclusion/exclusion filtering (`*`, '?', `-namespace:*`)
20+
- 🧪 Wildcard-based inclusion/exclusion filtering (`*`, `?`, `-namespace:*`)
2121
- 🔐 Thread-safe logging with `sync.RWMutex`
2222
- 🧰 Custom timestamp format and output writer support
23+
- 🎨 JSON output support
24+
- 🎨 Fields output support
2325

2426
---
2527

debugo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type Debugger struct {
2727
mutex *sync.Mutex
2828
}
2929

30+
// New creates a new debugger instance
3031
func New(namespace string) *Debugger {
3132
return newDebugger(namespace)
3233
}

write.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ type asJSON struct {
1515
ElapsedMs int64 `json:"elapsed_ms,omitempty"`
1616
}
1717

18+
// Debug logs a message if the debuggers namespace matches
1819
func (d *Debugger) Debug(message ...any) *Debugger {
1920
d.write(message...)
2021
return d
2122
}
2223

24+
// Debugf logs a formatted message if the debuggers namespace matches
2325
func (d *Debugger) Debugf(format string, message ...any) *Debugger {
2426
d.write(fmt.Sprintf(format, message...))
2527
return d

0 commit comments

Comments
 (0)