logger

package
v0.0.0-...-60cae77 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCloudLogger

func AddCloudLogger(ctx context.Context, projectID, loggerName string) error

AddCloudLogger adds stackdriver logging to the logger in the given project and log name.

func Close

func Close()

Close closes the logger.

func CreateLogger

func CreateLogger() error

CreateLogger initializes the logger for the server. The logs will be written to a local file called logs.txt.

func Error

func Error(v ...interface{})

Error outputs an error to the necessary logs.

func Log

func Log(v ...interface{})

Log outputs to the necessary logs. Arguments are handled in the manner of fmt.Println.

func Logf

func Logf(format string, v ...interface{})

Logf takes a format string and message and writes it to the necessary logs. Arguments are handled in the manner of fmt.Printf.

Types

type CloudLogger

type CloudLogger struct {
	*logging.Logger
	*logging.Client
}

CloudLogger handles writing logs to stackdriver.

type Logger

type Logger struct {
	*log.Logger
	*CloudLogger
	// contains filtered or unexported fields
}

Logger handles writing local logs to a file and cloud logs to Stackdriver.

Jump to

Keyboard shortcuts

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