Documentation
¶
Overview ¶
Package zap provides a BaseLogger implementation for uber/zap
Example ¶
This example shows how to use the zap backend with JSON output.
package main
import (
"context"
"github.com/go-coldbrew/log"
"github.com/go-coldbrew/log/loggers"
"github.com/go-coldbrew/log/loggers/zap"
)
func main() {
logger := zap.NewLogger(
loggers.WithJSONLogs(true),
loggers.WithCallerInfo(true),
)
log.SetLogger(log.NewLogger(logger))
ctx := context.Background()
log.Info(ctx, "msg", "request handled", "method", "POST", "latency_ms", 12)
}
Output:
Index ¶
Examples ¶
Constants ¶
View Source
const COLBREW_CALL_STACK_SIZE = 3
COLBREW_CALL_STACK_SIZE number stack frame involved between the logger call from application to zap call.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.