import "github.com/square/p2/pkg/logging" logger := logging.NewLogger("myapp") logger.Debug("Debug message") logger.Info("Info message") logger.Warn("Warn message") logger.Error("Error message")
import ( "github.com/square/p2/pkg/logging" "os" ) logger := logging.NewLogger("myapp") logger.SetOutput(os.Stdout) logger.Debug("Debug message")In this example, we create a logger and set the output to stdout. We then log a debug message, which will be output to the console. Overall, the github.com/square/p2/pkg/logging package provides a simple and easy-to-use logging framework for Go applications. It is designed to be extensible and configurable, with support for different logging backends and log message formats.