logging

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: MPL-2.0 Imports: 8 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 {
	AppName    string
	AppEnv     string
	AppRelease string
	SentryDsn  string
}

Config contains the details for configuring Logging

var Logging *Config

Logging is a singleton for managing logging

func New

func New() *Config

New creates a new struct for managing logging

func (*Config) Init

func (s *Config) Init()

Init set-ups logging for the Logrus library, incl. App name, environment and release, and Sentry DSN

func (*Config) SetDebug

func (s *Config) SetDebug(debug bool) *Config

SetDebug enables/disables debug logging

func (*Config) SetFormat

func (s *Config) SetFormat(loggingFormat string) (*Config, error)

SetFormat sets the log-output format: either "text" or "json"

func (*Config) SetFromConfig

func (s *Config) SetFromConfig() *Config

SetFromConfig sets App name and env, Log format, debug and Sentry DSN from config settings

Jump to

Keyboard shortcuts

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