logger

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	logr.Logger
}

Log for portability

func New

func New(name, logPath string, production bool) (*Log, error)

New creates a default logger based on what kind of environment is used.

func NewSimple

func NewSimple(name string) *Log

NewSimple creates a simple logger for barbaric purposes

Example
package main

import (
	"fmt"

	"github.com/SUNET/vc/pkg/logger"
)

func main() {
	log := logger.NewSimple("myservice")
	fmt.Printf("%T\n", log)
}
Output:
*logger.Log

func (*Log) Debug

func (l *Log) Debug(msg string, args ...any)

Debug log

func (*Log) Info

func (l *Log) Info(msg string, args ...any)

Info log

func (*Log) New

func (l *Log) New(path string) *Log

New creates a sub-logger of the original one

Example
package main

import (
	"fmt"

	"github.com/SUNET/vc/pkg/logger"
)

func main() {
	log := logger.NewSimple("myservice")
	sub := log.New("subsystem")
	fmt.Printf("%T\n", sub)
}
Output:
*logger.Log

func (*Log) Trace

func (l *Log) Trace(msg string, args ...any)

Trace log

func (*Log) Warn

func (l *Log) Warn(msg string, args ...any)

Warn log - same verbosity as Info but signals a potential problem

Jump to

Keyboard shortcuts

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