Created
July 17, 2023 06:50
-
-
Save percybolmer/cb3872d5d040cf1bfd0c98f079b4ace0 to your computer and use it in GitHub Desktop.
Slog - Simplest JSON logging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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