gokit

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

CI Go Report Card GoDoc

gokit

import "github.com/go-coldbrew/log/loggers/gokit"

Deprecated: Package gokit provides BaseLogger implementation for go-kit/log. The go-kit/log library is in maintenance mode and no longer actively developed. Use the slog backend (loggers/slog) instead, which is the default and recommended backend.

Example

This example shows how to use the gokit backend.

Deprecated: Use the slog backend instead (loggers/slog). The go-kit/log library is in maintenance mode and no longer actively developed.

package main

import (
	"context"

	"github.com/go-coldbrew/log"
	"github.com/go-coldbrew/log/loggers"
	"github.com/go-coldbrew/log/loggers/gokit"
)

func main() {
	logger := gokit.NewLogger(
		loggers.WithJSONLogs(true),
		loggers.WithCallerInfo(true),
	)
	log.SetLogger(log.NewLogger(logger))

	ctx := context.Background()
	log.Info(ctx, "msg", "request handled", "method", "GET", "path", "/api/v1")
}

Index

func NewLogger

func NewLogger(options ...loggers.Option) loggers.BaseLogger

NewLogger returns a base logger impl for go-kit log

Generated by gomarkdoc

Documentation

Overview

Deprecated: Package gokit provides BaseLogger implementation for go-kit/log. The go-kit/log library is in maintenance mode and no longer actively developed. Use the slog backend (loggers/slog) instead, which is the default and recommended backend.

Example

This example shows how to use the gokit backend.

Deprecated: Use the slog backend instead (loggers/slog). The go-kit/log library is in maintenance mode and no longer actively developed.

package main

import (
	"context"

	"github.com/go-coldbrew/log"
	"github.com/go-coldbrew/log/loggers"
	"github.com/go-coldbrew/log/loggers/gokit"
)

func main() {
	logger := gokit.NewLogger(
		loggers.WithJSONLogs(true),
		loggers.WithCallerInfo(true),
	)
	log.SetLogger(log.NewLogger(logger))

	ctx := context.Background()
	log.Info(ctx, "msg", "request handled", "method", "GET", "path", "/api/v1")
}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(options ...loggers.Option) loggers.BaseLogger

NewLogger returns a base logger impl for go-kit log

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL