Documentation ¶
Index ¶
- Constants
- Variables
- type ConsoleProvider
- type EmailProvider
- type Logger
- func (l *Logger) AddDebugProvider(provIDs ...string)
- func (l *Logger) AddErrorProvider(provIDs ...string)
- func (l *Logger) AddFatalProvider(provIDs ...string)
- func (l *Logger) AddLogProvider(provIDs ...string)
- func (l *Logger) Debug(messageParts ...interface{})
- func (l *Logger) Debugf(format string, params ...interface{})
- func (l *Logger) Error(messageParts ...interface{})
- func (l *Logger) Errorf(format string, params ...interface{})
- func (l *Logger) Fatal(messageParts ...interface{})
- func (l *Logger) Fatalf(format string, params ...interface{})
- func (l *Logger) Log(messageParts ...interface{})
- func (l *Logger) Logf(format string, params ...interface{})
- func (l *Logger) RegisterProvider(p ProviderInterface)
- func (l *Logger) SetLevel(level int)
- type ProviderInterface
- type TelegramProvider
Constants ¶
View Source
const ( LEVEL_ERROR int = iota LEVEL_INFO LEVEL_DEBUG )
View Source
const PROVIDER_CONSOLE = "console"
View Source
const PROVIDER_EMAIL = "email"
View Source
const PROVIDER_TELEGRAM = "telegram"
Variables ¶
View Source
var ( HOST string MESSAGE_REPLACER = strings.NewReplacer("\r", "", "\n", "\t") MESSAGE_SEPARATOR = []byte(" ") )
Functions ¶
This section is empty.
Types ¶
type ConsoleProvider ¶
type ConsoleProvider struct { }
func (ConsoleProvider) Debug ¶
func (p ConsoleProvider) Debug(msg []byte)
func (ConsoleProvider) Error ¶
func (p ConsoleProvider) Error(msg []byte)
func (ConsoleProvider) Fatal ¶
func (p ConsoleProvider) Fatal(msg []byte)
func (ConsoleProvider) GetID ¶
func (p ConsoleProvider) GetID() string
func (ConsoleProvider) Log ¶
func (p ConsoleProvider) Log(msg []byte)
type EmailProvider ¶
type EmailProvider struct {
// contains filtered or unexported fields
}
func NewEmailProvider ¶
func NewEmailProvider(address string, smtpClient *mail.SmtpClient) (*EmailProvider, error)
func (EmailProvider) Debug ¶
func (p EmailProvider) Debug(msg []byte)
func (EmailProvider) Error ¶
func (p EmailProvider) Error(msg []byte)
func (EmailProvider) Fatal ¶
func (p EmailProvider) Fatal(msg []byte)
func (EmailProvider) GetID ¶
func (p EmailProvider) GetID() string
func (EmailProvider) Log ¶
func (p EmailProvider) Log(msg []byte)
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) AddDebugProvider ¶
func (*Logger) AddErrorProvider ¶
func (*Logger) AddFatalProvider ¶
func (*Logger) AddLogProvider ¶
func (*Logger) RegisterProvider ¶
func (l *Logger) RegisterProvider(p ProviderInterface)
type ProviderInterface ¶
type TelegramProvider ¶
type TelegramProvider struct {
// contains filtered or unexported fields
}
func NewTelegramProvider ¶
func NewTelegramProvider(conn string, chatIds []string) (*TelegramProvider, error)
func (TelegramProvider) Debug ¶
func (p TelegramProvider) Debug(msg []byte)
func (TelegramProvider) Error ¶
func (p TelegramProvider) Error(msg []byte)
func (TelegramProvider) Fatal ¶
func (p TelegramProvider) Fatal(msg []byte)
func (TelegramProvider) GetID ¶
func (p TelegramProvider) GetID() string
func (TelegramProvider) Log ¶
func (p TelegramProvider) Log(msg []byte)
Click to show internal directories.
Click to hide internal directories.