Skip to content

Clarilab/slacklogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages