Documentation
¶
Overview ¶
Package service holds the methods necessary to support implementation of loggers that write to Google cloud service
Index ¶
Constants ¶
const ModeDebug = "debug"
const ModeRelease = "release"
const ModeSilent = "silent"
const ModeTesting = "testing"
Variables ¶
var Writer = alt4Writer{}
Writer can be used to override a normal/default go logger to write it's output to Google cloud logging This writer still respects log grouping if you're grouping your request logs Example log.SetOutput(Writer) for the default log package
Functions ¶
func CloseGroup ¶
func CloseGroup()
func Log ¶
func Log(callDepth int, message string, request *logging.HTTPRequest, labels map[string]string, level logging.Severity, logTime time.Time)
Log Creates a log entry and writes it to Google cloud logging in the background. This function should not be called directly and should instead be used from helper functions under the `log` package.
func SetDebugOutput ¶
SetDebugOutput Is used to specify where alt4 emits additional output e.g. when facing network errors. Defaults os.Stderr
func SetMode ¶
func SetMode(mode string)
SetMode Sets the behaviour of alt4 based on the following: `release` - Under this mode logs are written to Google cloud and not emitted to stdout `debug` - Under this mode logs are written to Google cloud and emitted to stdout `testing` - Under this mode logs are not written to Google cloud, just emitted to stdout `silent` - Under this mode logs are not written to Google cloud or emitted to stdout Mode can also be set using environment variable ALT4_MODE Default mode is `release`
Types ¶
This section is empty.