Created
December 16, 2021 11:11
-
-
Save karl-gustav/80a279ff4a7896f7be4c431031e609f1 to your computer and use it in GitHub Desktop.
using zap for logging in GCP
This file contains hidden or 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 ( | |
"github.com/blendle/zapdriver" | |
"go.uber.org/zap" | |
) | |
func main() { | |
structuredLogger, _ := zapdriver.NewProduction() | |
defer structuredLogger.Sync() // flushes buffer, if any | |
logger := structuredLogger.Sugar() | |
logger.Info("hello world"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment