logging

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Time   bool
	Debug  bool
	Trace  bool
	Colors bool
	PID    bool
}

Config defines logging flags for the NATS logger

type Logger

type Logger interface {
	Debugf(format string, v ...interface{})
	Errorf(format string, v ...interface{})
	Fatalf(format string, v ...interface{})
	Noticef(format string, v ...interface{})
	Tracef(format string, v ...interface{})
	Warnf(format string, v ...interface{})

	TraceEnabled() bool

	Close() error
}

Logger interface

func NewNATSLogger

func NewNATSLogger(conf Config) Logger

NewNATSLogger creates a new logger that uses the nats-server library

type NATSLogger

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

NATSLogger - uses the nats-server logging code

func (*NATSLogger) Close

func (logger *NATSLogger) Close() error

Close forwards to the nats logger

func (*NATSLogger) Debugf

func (logger *NATSLogger) Debugf(format string, v ...interface{})

Debugf forwards to the nats logger

func (*NATSLogger) Errorf

func (logger *NATSLogger) Errorf(format string, v ...interface{})

Errorf forwards to the nats logger

func (*NATSLogger) Fatalf

func (logger *NATSLogger) Fatalf(format string, v ...interface{})

Fatalf forwards to the nats logger

func (*NATSLogger) Noticef

func (logger *NATSLogger) Noticef(format string, v ...interface{})

Noticef forwards to the nats logger

func (*NATSLogger) TraceEnabled

func (logger *NATSLogger) TraceEnabled() bool

TraceEnabled returns true if tracing is configured, useful for fast path logging

func (*NATSLogger) Tracef

func (logger *NATSLogger) Tracef(format string, v ...interface{})

Tracef forwards to the nats logger

func (*NATSLogger) Warnf

func (logger *NATSLogger) Warnf(format string, v ...interface{})

Warnf forwards to the nats logger

Jump to

Keyboard shortcuts

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