logging

package
v0.0.0-...-e69eef7 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 97

Documentation

Overview

Package logging provides functionality for logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(level logrus.Level)

SetLogLevel sets the log level.

func SetLogLevelFromString

func SetLogLevelFromString(level string) error

SetLogLevelFromString sets the log level. SetLogLevelFromString returns an error if the given log level is not recognized by logrus.

func WithSource

func WithSource(wrapped logrus.Formatter) logrus.Formatter

WithSource allows to wrap a logrus.Formatter, to specify standard formatting options, whilst adding the souce of the log, i.e. the caller.

Types

type SimulatedHospitalLogger

type SimulatedHospitalLogger struct {
	*logrus.Entry
}

SimulatedHospitalLogger embeds the Logrus logger.

func ForCallerPackage

func ForCallerPackage() *SimulatedHospitalLogger

ForCallerPackage builds a base Entry that prefixes the name of the package from which it was called and can be used instead of the standard logger.

func (*SimulatedHospitalLogger) WithError

WithError adds an error as single field (using the key defined in ErrorKey) to the Entry. Overridden from logrus.Entry so that we can return a *SimulatedHospitalLogger.

func (*SimulatedHospitalLogger) WithField

func (s *SimulatedHospitalLogger) WithField(key string, value interface{}) *SimulatedHospitalLogger

WithField adds a single field to the Entry. Overridden from logrus.Entry so that we can return a *SimulatedHospitalLogger.

Jump to

Keyboard shortcuts

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