charm

package module
v0.0.0-...-5ba160d Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Charm

type Charm struct {
	// contains filtered or unexported fields
}

Charm is a client for https://github.com/charmbracelet/log.

func New

func New(o *Options) (*Charm, error)

New returns a new Charm with the given options.

func (*Charm) New

func (c *Charm) New(a ...any) logger.Log

func (*Charm) ReportCaller

func (c *Charm) ReportCaller()

func (*Charm) ReportTimestamp

func (c *Charm) ReportTimestamp(format string)

type Field

type Field struct {
	// contains filtered or unexported fields
}

func (*Field) Any

func (f *Field) Any(s string, a any) logger.Log

Any implements the logger.Log interface.

func (*Field) Debug

func (f *Field) Debug()

Debug implements the logger.Log interface.

func (*Field) Error

func (f *Field) Error()

Error implements the logger.Log interface.

func (*Field) Fatal

func (f *Field) Fatal()

Fatal implements the logger.Log interface.

func (*Field) Info

func (f *Field) Info()

Info implements the logger.Log interface.

func (*Field) Warn

func (f *Field) Warn()

Warn implements the logger.Log interface.

type Formatter

type Formatter uint8
const (
	Text Formatter = iota
	JSON
	Logfmt
)

type Level

type Level int32
const (
	Debug Level = -4
	Info  Level = 0
	Warn  Level = 4
	Error Level = 8
	Fatal Level = 12
)

type Options

type Options struct {
	Writer    io.Writer
	Level     Level
	Formatter Formatter
}

Options is Charm options.

Jump to

Keyboard shortcuts

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