stack

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 1 Imported by: 0

README

go-kratos-log-stack

Go Version GoDoc codecov Go Report Card tests MIT license

Installation

go get github.com/go-packagist/go-kratos-log-stack

Usage

package main

import (
	"os"

	"github.com/go-kratos/kratos/v2/log"
	slack "github.com/go-packagist/go-kratos-log-stack"
)

func main() {
	logger := slack.New([]log.Logger{
		log.NewStdLogger(os.Stdout),
		log.NewStdLogger(os.Stdout),
	})

	log.SetLogger(logger)

	log.Info("test", "test")
	// Print:
	// INFO msg=testtest
	// INFO msg=testtest
}

License

The MIT License (MIT). Please see License File for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(loggers []log.Logger, opts ...Option) log.Logger

Types

type Option

type Option func(*stackLogger)

func IgnoreExceptions

func IgnoreExceptions() Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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