Categorygithub.com/infiniteloopcloud/log
modulepackage
0.1.4
Repository: https://github.com/infiniteloopcloud/log.git
Documentation: pkg.go.dev

# README

Log

Usage

package main

import (
	"context"
	"errors"
	"fmt"

	"github.com/infiniteloopcloud/log"
)

const (
	CorrelationID log.ContextField = "correlation_id"
)

func main() {
	// Set this globally
	log.SetLevel(log.LevelToUint())
	log.SetLoggableFields([]fmt.Stringer{CorrelationID})
	 
	ctx := context.Background()
	ctx = context.WithValue(ctx, CorrelationID, "123456")
	log.Error(ctx, errors.New(""), "")
	log.Errorf(ctx, errors.New(""), "test: %s", "test")
	log.Warn(ctx, "")
	log.Info(ctx, "")
	log.Debug(ctx, "")
	// etc...
}

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

LevelEnvironmentVariable get the level of logging.

# Structs

No description provided by the author

# Type aliases

No description provided by the author