# Packages
No description provided by the author
# README
slog: Cloud Logging handler
A Google Cloud Logging Handler for slog Go library.
Install
go get github.com/PumpkinSeed/slog-cloudlogging
Usage
GoDoc: https://pkg.go.dev/github.com/PumpkinSeed/slog-cloudlogging
Example
package main
import (
"errors"
"log/slog"
"time"
slogcloudlogging "github.com/PumpkinSeed/slog-cloudlogging"
)
func main() {
googleHandler := slogcloudlogging.NewHandler("test", "test-logs", nil)
googleHandler.AutoFlush()
slog.SetDefault(slog.New(googleHandler))
slog.Error("test message", slog.Any("error", errors.New("this is an error")))
time.Sleep(2 * time.Second) // Wait for the Flush
}