Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save percybolmer/cb3872d5d040cf1bfd0c98f079b4ace0 to your computer and use it in GitHub Desktop.
Save percybolmer/cb3872d5d040cf1bfd0c98f079b4ace0 to your computer and use it in GitHub Desktop.
Slog - Simplest JSON logging
package main
import (
"os"
"golang.org/x/exp/slog"
)
func main() {
jsonHandler := slog.NewJSONHandler(os.Stdout, nil)
logger := slog.New(jsonHandler)
logger.Info("Welcome to SolarWatch")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment