golog

package module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 4 Imported by: 0

README

Go-Log

Go simple logging to cloud webhook

Go-log its library for Go to log to cloud webhook. And now just support for :

  • Slack Webhook

Installation

Install go depedency on your projects

go get github.com/pandeptwidyaop/golog

Using Slack Webhook

Set Evironment Variable
Env Key Note
SLACK_WEBHOOK_URL Your Slack Webhook Url
SLACK_USERNAME Slack Username to show on log
SLACK_CHANNEL Slack channel to send log

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string) string

func New

func New()

func NewCustomInstance added in v0.0.5

func NewCustomInstance(channel string, username string, url string)

Types

type SlackWebhook

type SlackWebhook struct {
	URL      string
	Username string
	Channel  string
	Icon     string
}
var Slack SlackWebhook

func (*SlackWebhook) Error

func (s *SlackWebhook) Error(message string, e error)

func (*SlackWebhook) ErrorWithData

func (s *SlackWebhook) ErrorWithData(message string, data []byte, e error)

func (*SlackWebhook) Info

func (s *SlackWebhook) Info(message string)

func (*SlackWebhook) InfoWidthData

func (s *SlackWebhook) InfoWidthData(message string, data []byte)

func (*SlackWebhook) Warning

func (s *SlackWebhook) Warning(message string, e error)

func (*SlackWebhook) WarningWithData

func (s *SlackWebhook) WarningWithData(message string, data []byte, e error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL