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 ¶
- type Grip
- func (g *Grip) Alert(msg interface{})
- func (g *Grip) AlertWhen(conditional bool, m interface{})
- func (g *Grip) Alertf(msg string, a ...interface{})
- func (g *Grip) Alertln(a ...interface{})
- func (g *Grip) Critical(msg interface{})
- func (g *Grip) CriticalWhen(conditional bool, m interface{})
- func (g *Grip) Criticalf(msg string, a ...interface{})
- func (g *Grip) Criticalln(a ...interface{})
- func (g *Grip) Debug(msg interface{})
- func (g *Grip) DebugWhen(conditional bool, m interface{})
- func (g *Grip) Debugf(msg string, a ...interface{})
- func (g *Grip) Debugln(a ...interface{})
- func (g *Grip) Emergency(msg interface{})
- func (g *Grip) EmergencyFatal(msg interface{})
- func (g *Grip) EmergencyPanic(msg interface{})
- func (g *Grip) EmergencyWhen(conditional bool, m interface{})
- func (g *Grip) Emergencyf(msg string, a ...interface{})
- func (g *Grip) Emergencyln(a ...interface{})
- func (g *Grip) Error(msg interface{})
- func (g *Grip) ErrorWhen(conditional bool, m interface{})
- func (g *Grip) Errorf(msg string, a ...interface{})
- func (g *Grip) Errorln(a ...interface{})
- func (g *Grip) GetSender() send.Sender
- func (g *Grip) Info(msg interface{})
- func (g *Grip) InfoWhen(conditional bool, m interface{})
- func (g *Grip) Infof(msg string, a ...interface{})
- func (g *Grip) Infoln(a ...interface{})
- func (g *Grip) Log(l level.Priority, msg interface{})
- func (g *Grip) LogWhen(conditional bool, l level.Priority, m interface{})
- func (g *Grip) Logf(l level.Priority, msg string, a ...interface{})
- func (g *Grip) Logln(l level.Priority, a ...interface{})
- func (g *Grip) Name() string
- func (g *Grip) Notice(msg interface{})
- func (g *Grip) NoticeWhen(conditional bool, m interface{})
- func (g *Grip) Noticef(msg string, a ...interface{})
- func (g *Grip) Noticeln(a ...interface{})
- func (g *Grip) Send(m interface{})
- func (g *Grip) SetLevel(info send.LevelInfo) error
- func (g *Grip) SetName(n string)
- func (g *Grip) SetSender(s send.Sender) error
- func (g *Grip) Warning(msg interface{})
- func (g *Grip) WarningWhen(conditional bool, m interface{})
- func (g *Grip) Warningf(msg string, a ...interface{})
- func (g *Grip) Warningln(a ...interface{})
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 NewGrip ¶
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) CriticalWhen ¶
func (*Grip) Criticalln ¶
func (g *Grip) Criticalln(a ...interface{})
func (*Grip) EmergencyFatal ¶
func (g *Grip) EmergencyFatal(msg interface{})
func (*Grip) EmergencyPanic ¶
func (g *Grip) EmergencyPanic(msg interface{})
func (*Grip) EmergencyWhen ¶
func (*Grip) Emergencyf ¶
func (*Grip) Emergencyln ¶
func (g *Grip) Emergencyln(a ...interface{})
func (*Grip) GetSender ¶
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) NoticeWhen ¶
func (*Grip) SetSender ¶
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.