-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstatic.go
More file actions
32 lines (26 loc) · 885 Bytes
/
static.go
File metadata and controls
32 lines (26 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package goqueue
import (
"os"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/bxcodec/goqueue/internal/shared"
)
// SetupLogging configures zerolog with sensible defaults for goqueue.
// This is automatically called when importing consumer or publisher packages,
// but can be called explicitly for custom configuration.
//
// Note: This function is safe to call multiple times.
func SetupLogging() {
shared.SetupLogging()
}
// SetupLoggingWithDefaults configures zerolog and sets up a default global logger
// with console output and reasonable formatting for development.
// This is useful for development environments or when you want pretty-printed logs.
func SetupLoggingWithDefaults() {
SetupLogging()
// Set up a nice console logger for development
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout}).
With().
Caller().
Logger()
}