Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slacklogger

This client is used to send messages using a slack webhook url.

Installation

go get github.com/Clarilab/slacklogger/v2

Importing

import "github.com/Clarilab/slacklogger/v2"

Examples

Logging with an instanced logger

webhookURL := "https://hooks.slack.com/..."
environment := "development"
isDebug := false

slacker := slacklogger.NewSlackLogger(webhookURL, environment, isDebug)

slacker.Log("Something weird")

// this will result in: env=development Something weird

Logging without an instanced logger

webhookURL := "https://hooks.slack.com/..."
environment := ""
isDebug := false
message := "Hello World!"


slacklogger.LogWithURL(message, webhookURL, environment, isDebug)

// this will result in: Hello World!

If isDebug is set to true, it will print to stdout instead.

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages