logging

package
v0.0.0-...-863240d Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logging provides the primary implementation of the Journaler interface (which is cloned in public functions in the grip interface itself.)

Basic Logging

Loging helpers exist for the following levels:

Emergency + (fatal/panic)
Alert + (fatal/panic)
Critical + (fatal/panic)
Error + (fatal/panic)
Warning
Notice
Info
Debug

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Grip

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

Grip provides the core implementation of the Logging interface. The interface is mirrored in the "grip" package's public interface, to provide a single, global logging interface that requires minimal configuration.

func MakeGrip

func MakeGrip(s send.Sender) *Grip

MakeGrip builds a new logging interface from a sender implmementation

func NewGrip

func NewGrip(name string) *Grip

NewGrip takes the name for a logging instance and creates a new Grip instance with configured with a local, standard output logging. The default level is "Notice" and the threshold level is "info."

func (*Grip) Alert

func (g *Grip) Alert(msg interface{})

func (*Grip) AlertWhen

func (g *Grip) AlertWhen(conditional bool, m interface{})

func (*Grip) Alertf

func (g *Grip) Alertf(msg string, a ...interface{})

func (*Grip) Alertln

func (g *Grip) Alertln(a ...interface{})

func (*Grip) Critical

func (g *Grip) Critical(msg interface{})

func (*Grip) CriticalWhen

func (g *Grip) CriticalWhen(conditional bool, m interface{})

func (*Grip) Criticalf

func (g *Grip) Criticalf(msg string, a ...interface{})

func (*Grip) Criticalln

func (g *Grip) Criticalln(a ...interface{})

func (*Grip) Debug

func (g *Grip) Debug(msg interface{})

func (*Grip) DebugWhen

func (g *Grip) DebugWhen(conditional bool, m interface{})

func (*Grip) Debugf

func (g *Grip) Debugf(msg string, a ...interface{})

func (*Grip) Debugln

func (g *Grip) Debugln(a ...interface{})

func (*Grip) Emergency

func (g *Grip) Emergency(msg interface{})

func (*Grip) EmergencyFatal

func (g *Grip) EmergencyFatal(msg interface{})

func (*Grip) EmergencyPanic

func (g *Grip) EmergencyPanic(msg interface{})

func (*Grip) EmergencyWhen

func (g *Grip) EmergencyWhen(conditional bool, m interface{})

func (*Grip) Emergencyf

func (g *Grip) Emergencyf(msg string, a ...interface{})

func (*Grip) Emergencyln

func (g *Grip) Emergencyln(a ...interface{})

func (*Grip) Error

func (g *Grip) Error(msg interface{})

func (*Grip) ErrorWhen

func (g *Grip) ErrorWhen(conditional bool, m interface{})

func (*Grip) Errorf

func (g *Grip) Errorf(msg string, a ...interface{})

func (*Grip) Errorln

func (g *Grip) Errorln(a ...interface{})

func (*Grip) GetSender

func (g *Grip) GetSender() send.Sender

GetSender returns the current Journaler's sender instance. Use this in combination with SetSender() to have multiple Journaler instances backed by the same send.Sender instance.

func (*Grip) Info

func (g *Grip) Info(msg interface{})

func (*Grip) InfoWhen

func (g *Grip) InfoWhen(conditional bool, m interface{})

func (*Grip) Infof

func (g *Grip) Infof(msg string, a ...interface{})

func (*Grip) Infoln

func (g *Grip) Infoln(a ...interface{})

func (*Grip) Log

func (g *Grip) Log(l level.Priority, msg interface{})

func (*Grip) LogWhen

func (g *Grip) LogWhen(conditional bool, l level.Priority, m interface{})

func (*Grip) Logf

func (g *Grip) Logf(l level.Priority, msg string, a ...interface{})

func (*Grip) Logln

func (g *Grip) Logln(l level.Priority, a ...interface{})

func (*Grip) Name

func (g *Grip) Name() string

func (*Grip) Notice

func (g *Grip) Notice(msg interface{})

func (*Grip) NoticeWhen

func (g *Grip) NoticeWhen(conditional bool, m interface{})

func (*Grip) Noticef

func (g *Grip) Noticef(msg string, a ...interface{})

func (*Grip) Noticeln

func (g *Grip) Noticeln(a ...interface{})

func (*Grip) Send

func (g *Grip) Send(m interface{})

func (*Grip) SetLevel

func (g *Grip) SetLevel(info send.LevelInfo) error

func (*Grip) SetName

func (g *Grip) SetName(n string)

func (*Grip) SetSender

func (g *Grip) SetSender(s send.Sender) error

SetSender swaps send.Sender() implementations in a logging instance. Calls the Close() method on the existing instance before changing the implementation for the current instance. SetSender will configure the incoming sender to have the same name as well as default and threshold level as the outgoing sender.

func (*Grip) Warning

func (g *Grip) Warning(msg interface{})

func (*Grip) WarningWhen

func (g *Grip) WarningWhen(conditional bool, m interface{})

func (*Grip) Warningf

func (g *Grip) Warningf(msg string, a ...interface{})

func (*Grip) Warningln

func (g *Grip) Warningln(a ...interface{})

Jump to

Keyboard shortcuts

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