log

package
v0.0.0-...-4dca428 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 14

Documentation

Overview

A simple log utility. Supports following two log formats. Set environment variable `LOG_FORMAT` to the corresponding value: 1. json 2. text Text format is the default

Index

Constants

View Source
const (
	LogFormatDefault = "text"
	LogFormatJSON    = "json"
)

Constants for log format

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

Log at Debug level

func Fatal

func Fatal(err error)

Log at Fatal level. Sequence is: 1. Log the actual error 2. Exit with code 1

func Info

func Info(msg string)

Log at Info level

func Warn

func Warn(msg string, err error)

Log at WARN level. Logs the err message first followed by the whole error

Types

type Logger

type Logger struct {
}

Implementing pkg/log/Logger interface

func (Logger) Debugf

func (logger Logger) Debugf(format string, args ...interface{})

func (Logger) Errorf

func (logger Logger) Errorf(format string, args ...interface{})

func (Logger) Infof

func (logger Logger) Infof(format string, args ...interface{})

func (Logger) Warnf

func (logger Logger) Warnf(format string, args ...interface{})

Jump to

Keyboard shortcuts

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