sawmill

package module
v0.0.0-...-75f95e6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	ErrorClient *errorreporting.Client // The client generated by Google

	// If their was an error with the initialization, InitError will be true, so when an error logging function is called, nothing will happen
	// If the initialization fails, it will just print the same error that we already log when the Client is initialized
	// Basically InitError just reduces log clutter
	InitError bool

	ServiceName string // The service that logging was created for
}

Logger holds the newly generated error logging client, so that it can be used for our own, more simple custom logging functions instead of the ones the Google provides

func InitClient

func InitClient(serviceName string) (Logger, error)

InitClient accesses the enviroment variables on its own, and creates an error logging client

func (Logger) LogErr

func (c Logger) LogErr(err error, operation string, optionalArgs ...interface{})

LogErr logs an error with Google Cloud

Jump to

Keyboard shortcuts

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