Skip to content

Commit

Permalink
Merge pull request #5 from Clarilab/iowriter
Browse files Browse the repository at this point in the history
Implement Write function to fulfill io.Writer interface
  • Loading branch information
MaxBreida authored Sep 5, 2023
2 parents e94949e + 0bdb70e commit 5a453e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions slacklogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ func (logger *SlackLogger) Log(message string) {
LogWithURL(message, logger.webhookURL, logger.environment, logger.isDebug)
}

func (logger *SlackLogger) Write(message []byte) (int, error) {
logger.Log(string(message))

return len(message), nil
}

func LogWithURL(message, url, env string, isDebug bool) {
if env != "" {
message = fmt.Sprintf("env=%s, %s", env, message)
Expand Down

0 comments on commit 5a453e5

Please sign in to comment.