slclogger: github.com/iktakahiro/slclogger Index | Files

package slclogger

import "github.com/iktakahiro/slclogger"

Index

Package Files

slclogger.go

Constants

const (
    LevelDebug logLevel = iota + 1
    LevelInfo
    LevelWarn
    LevelError
)

LogLevel Constants

type LoggerParams Uses

type LoggerParams struct {
    WebHookURL     string
    LogLevel       logLevel
    DefaultChannel string
    DebugChannel   string
    InfoChannel    string
    WarnChannel    string
    ErrorChannel   string
    UserName       string
    DefaultTitle   string
    IconURL        string
}

LoggerParams is the set of parameters that can be used when creating a new SlcLogger.

type SlcErr Uses

type SlcErr struct {
    Err  error
    Code int
}

SlcErr is a struct for Slack response error code.

func (*SlcErr) Error Uses

func (s *SlcErr) Error() string

Error is an implementation of the error interface.

type SlcLogger Uses

type SlcLogger struct {
    WebHookURL string
    LoggerParams
    LogLevel     logLevel
    DebugChannel string
    InfoChannel  string
    WarnChannel  string
    ErrorChannel string
    UserName     string
    DefaultTitle string
    IconURL      string
}

SlcLogger is the structure detailing logger.

func NewSlcLogger Uses

func NewSlcLogger(params *LoggerParams) (*SlcLogger, error)

NewSlcLogger returns a new SLcLogger.

func (*SlcLogger) Debug Uses

func (s *SlcLogger) Debug(message interface{}, title ...string) error

Debug is a wrapper function of sendNotification function that implicitly sets the logLevel and color.

func (*SlcLogger) Error Uses

func (s *SlcLogger) Error(message interface{}, title ...string) error

Error is a wrapper function of sendNotification function that implicitly sets the logLevel and color.

func (*SlcLogger) Info Uses

func (s *SlcLogger) Info(message interface{}, title ...string) error

Info is a wrapper function of sendNotification function that implicitly sets the logLevel and color.

func (*SlcLogger) SetLogLevel Uses

func (s *SlcLogger) SetLogLevel(level logLevel)

SetLogLevel sets a logLevel to SlcLogger.LogLevel.

func (*SlcLogger) Warn Uses

func (s *SlcLogger) Warn(message interface{}, title ...string) error

Warn is a wrapper function of sendNotification function that implicitly sets the logLevel and color.

Package slclogger imports 9 packages (graph). Updated 2019-05-05. Refresh now. Tools for package owners.