package main import ( "github.com/evergreen-ci/evergreen/plugin" "github.com/evergreen-ci/evergreen/plugin/logger" ) func main() { plugin.Logger(logger.Debug, "This is a debug message") plugin.Logger(logger.Info, "This is an info message") plugin.Logger(logger.Warning, "This is a warning message") plugin.Logger(logger.Error, "This is an error message") plugin.Logger(logger.Fatal, "This is a fatal message") }
package main import ( "github.com/evergreen-ci/evergreen/plugin" "github.com/evergreen-ci/evergreen/plugin/logger" ) func main() { plugin.ConfigureLogger(logger.Config{ Level: logger.Debug, LogFile: "/var/log/myplugin.log", }) plugin.Logger(logger.Debug, "This is a debug message") }In this code example, we use the ConfigureLogger function to configure the Logger package before logging the message. We set the logging level to Debug and specify a custom log file location. We then use the Debug level to log a message to the specified log file.